homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Transfer variables
jacobp




msg:3646706
 2:25 pm on May 10, 2008 (gmt 0)

Hello,

I need help :-)

How can I transfer/send "ItemPageNo" + "ItemStartPaging"-variables to ItemSearch() in stateChanged_ItemOpen() ?

function ItemOpen(ItemGuid, ItemPageNo, ItemStartPaging)
{
xmlHttp = GetXmlHttpObject();
if (xmlHttp == null)
{
alert ("Your browser does not support AJAX!");
return;
}

var url = "/Ajax/ItemOpen.phtml";
url = url + "?ItemGuid=" + ItemGuid;
xmlHttp.onreadystatechange=stateChanged_ItemOpen;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged_ItemOpen()
{
if (xmlHttp.readyState == 4)
{
document.getElementById("ItemOpen").innerHTML = xmlHttp.responseText;
ItemSearch(ItemPage, ItemStartPaging);
}
}

Jacob

 

daveVk




msg:3647095
 5:23 am on May 11, 2008 (gmt 0)

The easy and somewhat ugly way is to pass the values by global variables. The alternative is to use a closure [jibbering.com...] see callLater example.

jacobp




msg:3648931
 3:55 pm on May 13, 2008 (gmt 0)

Oh yes - ofcourse :-)

Thanks for help.

Jacob

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved