Free Web Hosting Forum
(#1 (permalink))
Old
Member
willettmatter is on a distinguished road
 
Posts: 61
Join Date: Jan 2012
Location: Idaho
Default dynamic issues - 02-27-2012, 10:31 PM

ok here is the pertinent coding:
In the script is:

var xmlhttp;
function loadXMLDoc(url,dofunc)
{

xmlhttp=new XMLHttpRequest();

xmlhttp.onreadystatechange=dofunc;
xmlhttp.open("GET",url,true);
xmlhttp.send();
}
function cartload()
{
loadXMLDoc("http://willettmatter.com/harvard/pizza/cart.php, function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("cart").innerHTML=xmlhttp. reponseText;
}
});
}

and the trigger for that :
<input type="button" value="stuff" onclick="cartload()" />

I use dynamic loading in a couple of pages, including the page I'm working on. It works in one place on this page.

the kicker is when I click the button, all I get is the word "undefined". it even shows in the 'cart' division, in the correct place.
I know cart.php works, I can browse to it. I can add $_GET stuff and it works fine. In developer tools I have no errors. It even shows 'undefined' in the cart div.
any idea why it won't define?


willettmatter.com
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
purcellj's Avatar
Senior Member
purcellj is on a distinguished road
 
Posts: 218
Join Date: Aug 2010
Location: Bedford, Bedfordshire, England
Send a message via Skype™ to purcellj
Default 02-28-2012, 08:55 PM

Sorry mate, would help but my focus is PHP...
Maybe soon, you will get the answer


Don't be an idiot, read the Terms Of Service | Nerd Chat | Service Status
Reply With Quote
(#3 (permalink))
Old
Member
willettmatter is on a distinguished road
 
Posts: 61
Join Date: Jan 2012
Location: Idaho
Default 03-02-2012, 11:23 AM

Thanks for the response Purcellj. Turns out the problem with the script was the fool that wrote it. . I don't know what comma I missed, but I just had to rewrite it.


willettmatter.com
Reply With Quote
Reply

Tags
ajax, javascript

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com