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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.