Jump to content

[SOLVED] Ajax Issue


radar

Recommended Posts

Here is the code im having an issue with:

 

function GetAttendees(qty)

{

var url = "getattendees.php?qty="+qty;

var pars=''; //alert(url);	

var myAjax = new Ajax.Request(

url,

{

	method: 'post',

	parameters: pars,

	onComplete: ShowSubMyInfoControl

});

}

function ShowSubMyInfoControl(originalRequest)

{

var x=originalRequest.responseText;

document.getElementById('attendees').innerHTML=x;

}

</script>

 

What it is telling me is ajax is undefined.

 

I checked prototype.js and on line 1587 of the file starts the common error of this:

 

Ajax.Responders.register({

 

  onCreate: function() {

 

    Ajax.activeRequestCount++;

 

  },

 

  onComplete: function() {

 

    Ajax.activeRequestCount--;

 

  }

 

});

 

and the code to include prototype.js onto the first page is:

 

<script type='text/javascript' src="prototype.js"></script>

 

The error on this in IE7 is:

 

var myAjax = new Ajax.Request(

 

url,

 

{

 

method: 'post',

 

parameters: pars,

 

onComplete: ShowSubMyInfoControl

 

});

 

That is in the main php file.

 

Any help on this is appreciated, thanks.

Link to comment
https://forums.phpfreaks.com/topic/145650-solved-ajax-issue/
Share on other sites

Okay again, I solved this on my own -- and without knowing javascript or ajax.

 

My solution, in case others are having the same issue using prototype.js was to upgrade to a newer version of the script.

 

The original version was 1.5.0

 

The upgraded version is 1.6.0.3

 

If you need the upgraded file you can get it by going here: http://www.prototypejs.org/download

 

Hope it helps someone.

Link to comment
https://forums.phpfreaks.com/topic/145650-solved-ajax-issue/#findComment-764651
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.