First of all let me tell you I am very new at this and trying to learn.
This is for a game that I play on facebook. What this code is suppose to do is add all members to my team. What it actually does now is it seams to work but when it is done nothing changed. I will post full code below and snippets here.

Basically I am trying to make it run this link:
add_url%2Bfriends%5B0%5D.id%29%3B%7D

Using this definition:
add_url%3D%27http%3A%2F%2Fapps.facebook.com%2Finthemafia%2Fstatus_invite.php%3Ffrom%3D%27%3Bvar%20

So it should look like this:
http://apps.facebook.com/inthemafia/...from=503314241

If you run the javascript and using firebug, it shows that it trys to load what it should and the status shows ok, but it doesn't actually work. If you run the exact same link then it works. i do not know where the code is for the id but I have supplied the full code below.


[CODE]
javascript:void%28function%28%29%7Bvar%20xmlHTTP%3Bvar%20last_url%3Dnull%3Bvar%20retries%3D0%3Bfunct ion%20get_xmlHTTP%28%29%7Bif%28window.XMLHttpRequest%29return%20new%20XMLHttpRequest%28%29%3Bif%28wi ndow.ActiveXObject%29return%20new%20ActiveXObject%28%22Microsoft.XMLHTTP%22%29%3Breturn%20null%3B%7D function%20request%28url%29%7BxmlHTTP.onreadystatechange%3Dstate_change%3BxmlHTTP.open%28%22GET%22%2 Curl%2Ctrue%29%3BxmlHTTP.send%28null%29%3Blast_url%3Durl%3B%7Dfunction%20retry%28s%29%7Bif%28retries %3E9%29%7Bmsg%28s%2B%27%3B%20not%20retrying%20any%20more.%27%29%3B%7Delse%7Bretries%2B%2B%3Bmsg%28s% 2B%27%3B%20retry%20%23%27%2Bretries%2B%27...%27%29%3Brequest%28last_url%29%3B%7D%7Dvar%20recruit_url %3D%27http%3A%2F%2Fapps.facebook.com%2Finthemafia%2Fremote%2Fhtml_server.php%3Fxw_controller%3Drecru it%26xw_action%3Dview%27%3Bvar%20add_url%3D%27http%3A%2F%2Fapps.facebook.com%2Finthemafia%2Fstatus_i nvite.php%3Ffrom%3D%27%3Bvar%20mw_url%3D%27http%3A%2F%2Fapps.facebook.com%2Finthemafia%2Fstatus_invi te.php%3Ffrom%3D%27%3Bvar%20fb_url%3D%27http%3A%2F%2Fwww.facebook.com%2Fprofile.php%3Fid%3D%27%3Bvar %20friends_added%3D0%3Bvar%20friends%3Dnull%3Bvar%20first%3Dtrue%3Bvar%20wait%3D1%3Bvar%20content%3D document.getElementById%28%27app10979261223_content_row%27%29%3Bvar%20heartrate_div%3Ddocument.creat eElement%28%22div%22%29%3Bheartrate_div.innerHTML%3D%27%3Ctable%20class%3D%22messages%22%3E%3Ctr%3E% 3Ctd%20colspan%3D%222%22%20style%3D%22text-align%3A%20right%22%3E%3Ca%20href%3D%22http%3A%2F%2Fheartrate.se%2F%22%20style%3D%22margin-left%3A%20auto%22%3E%3Cimg%20src%3D%22http%3A%2F%2Fheartrate.se%2Fimages%2Fbanner_small.png%22%20wid th%3D%22208px%22%20height%3D%2225px%22%20%2F%3E%3C%2Fa%3E%3C%2Ftd%3E%3C%2Ftr%3E%3Ctr%3E%3Ctd%20width %3D%2220%25%22%3EFriends%20added%3A%3C%2Ftd%3E%3Ctd%20id%3D%22friends_added%22%3E%3C%2Ftd%3E%3C%2Ftr %3E%3Ctr%3E%3Ctd%3ETo%20try%3A%3C%2Ftd%3E%3Ctd%20id%3D%22friends_left%22%3E%3C%2Ftd%3E%3C%2Ftr%3E%3C tr%3E%3Ctd%3EStatus%3A%3C%2Ftd%3E%3Ctd%20id%3D%22heartrate_status%22%3E%3C%2Ftd%3E%3C%2Ftr%3E%3Ctr%3 E%3Ctd%20valign%3D%22top%22%3ELog%3A%3C%2Ftd%3E%3Ctd%20id%3D%22heartrate_log%22%3E%3C%2Ftd%3E%3C%2Ft r%3E%3C%2Ftable%3E%27%3Bcontent.insertBefore%28heartrate_div%2Ccontent.firstChild%29%3Bfunction%20ms g%28log%29%7Bdocument.getElementById%28%27friends_added%27%29.innerHTML%3Dfriends_added%3Bdocument.g etElementById%28%27friends_left%27%29.innerHTML%3Dfriends.length%3Bvar%20l%3Ddocument.getElementById %28%27heartrate_log%27%29%3Bl.innerHTML%3Dlog%2B%27%3Cbr%20%2F%3E%27%2Bl.innerHTML%3B%7Dfunction%20s tatus%28s%29%7Bdocument.getElementById%28%27heartrate_status%27%29.innerHTML%3Ds%3B%7Dfunction%20fbl ink%28%29%7Breturn%27%3Ca%20href%3D%22%27%2Bfb_url%2Bfriends%5B0%5D.id%2B%27%22%3E%27%2Bfriends%5B0% 5D.name%2B%27%3C%2Fa%3E%27%3B%7Dfunction%20mwlink%28s%29%7Breturn%27%3Ca%20href%3D%22%27%2Bmw_url%2B friends%5B0%5D.id%2B%27%22%3E%27%2Bs%2B%27%3C%2Fa%3E%27%3B%7Dfunction%20request_next%28%29%7Bfunctio n%20f%28%29%7Bstatus%28%27Adding%20%27%2Bfblink%28%29%2B%27...%27%29%3Brequest%28add_url%2Bfriends%5 B0%5D.id%29%3B%7Dif%28friends.length%3E0%29%7Bif%28first%29%7Bfirst%3Dfalse%3Bf%28%29%3B%7Delse%7Bst atus%28%27Waiting%20for%20%27%2Bwait%2B%27%20seconds...%27%29%3BsetTimeout%28f%2Cwait%2A1000%29%3B%7 D%7Delse%7Bstatus%28%27All%20done%27%29%3Bmsg%28%27%27%29%3B%7D%7Dfunction%20state_change%28%29%7Bif %28xmlHTTP.readyState%3D%3D4%29%7Bif%28xmlHTTP.status%3D%3D200%29%7Bmsg%28%27Tried%20adding%20%27%2B fblink%28%29%2B%27%20%28%27%2Bmwlink%28%27ADDTOMAFIA%27%29%2B%27%29%27%29%3Bretries%3D0%3Bfriends%3D friends.slice%281%29%3Brequest_next%28%29%3B%7Delse%7Bretry%28%27Problem%20retrieving%20data%27%29%3 Breturn%3B%7D%7D%7Dfunction%20begin%28%29%7Bvar%20xpath%3D%22%2F%2Fdiv%5B%40class%3D%27unselected_li st%27%5D%2F%2Flabel%5B%40class%3D%27clearfix%27%5D%22%3Bvar%20results%3Ddocument.evaluate%28xpath%2C document%2Cnull%2CXPathResult.ORDERED_NODE_SNAPSHOT_TYPE%2Cnull%29%3Bvar%20i%3D0%3Bfriends%3D%5B%5D% 3Bwhile%28%28res%3Dresults.snapshotItem%28i%29%29%21%3Dnull%29%7Bfriends%5Bfriends.length%5D%3D%7B%2 7id%27%3Ares.firstChild.value%2C%27name%27%3Ares.lastChild.innerHTML%7D%3Bi%2B%2B%3B%7Dif%28i%3D%3D0 %29%7Bstatus%28%27Run%20this%20bookmarklet%20from%20%3Ca%20href%3D%22%27%2Brecruit_url%2B%27%22%3Eth e%20recruit%20page%3C%2Fa%3E.%27%29%3B%7Delse%7Bmsg%28%27Found%20%27%2Bi%2B%27%20friends%20not%20yet %20in%20your%20mafia%27%29%3Bwait%3Dprompt%28%27Enter%20delay%20between%20requests%20in%20seconds.%2 7%2C10%29%3Brequest_next%28%29%3B%7D%7DxmlHTTP%3Dget_xmlHTTP%28%29%3Bif%28%21xmlHTTP%29%7Balert%28%2 2Your%20browser%20does%20not%20support%20XMLHTTP.%22%29%3Breturn%3B%7Dbegin%28%29%3B%7D%28%29%29%3B [CODE]