Forum Moderators: open

Message Too Old, No Replies

AJAX stops working after the first call to Ajax is used

         

rafarataneneces

8:03 am on Oct 29, 2010 (gmt 0)

10+ Year Member



Hello.

I'd appreciate if someone can check the code from this page:

[gamingaccess.com ]

It's a FLV player that changes chapters of a video.
For example, MMA Weekly has 4 parts, and I can switch from part 1 to part 2 with no problem

HOWEVER, after I see part 2, I can't use Ajax anymore, the only thing I can do is reload the page in order to see part 3

I have to reload the page again if I want to see part 4

I appreciate the responses

Fotiman

12:41 pm on Oct 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can you post the code that does the AJAX request? If you want to reuse an AJAX connection, make sure you call open before you set the onreadystatechange handler. Alternatively, I've ready that you can call abort before calling send again.

For example:

// 1. Call open
XHR.open("GET", url, true);
// 2. Set onreadystatechange handler
XHR.onreadystatechange = function () {alert('ZOINKS!');}
// 3. Send
XHR.send();

rafarataneneces

2:58 pm on Oct 29, 2010 (gmt 0)

10+ Year Member



I fixed it, it was a div somewhere that wasn't named properly

Thanks