Jump to content

Another 2 Ajax Question :(


morrisjohnny

Recommended Posts

I have another few questions in regards to AJAXI'll state the most important firstI wish to have two AJAX areas within one document.I've learnt (from trail and error) you cannot simply attach another <script src="ajax.js"></script>. So i tried including another function within ajax.js again this wasn't successful.Now i though about creating an if statement However I'm unsure how i would go about doing this. (i'm not using hyper links so i can post a link threw that way i'm using <input onChange="showCode(this.value);" />$_POST instead of $_GETI was also wondering how i would go about using $_POST in AJAX instead of $_GET as one of my strings is going to be bigger than the maximum amount aloud for $_GET. I have a solution using $_GET however it is not ideal and knowing how to use the $_POST feature in AJAX would be something i would be more likely to use.

Link to comment
Share on other sites

What exactly do you really know about AJAX? From the looks of it, you've either been using a library, or simply haven't tried to see how HTTP looks like (or both).Take a look at the XMLHttpRequest() object. If you've been using a library, it's time to try out the real thing.You specify the method as the first argument to open(), and send the HTTP body (in your case - POST data) as an argument to send(). Each XMLHttpRequest object deals with one URL at a time, but you can always have two objects (in two different variables), or switch the URL at some point.You might want to get Fiddler (see my signature) in order to look at the HTTP traffic, and what exactly is happening at each moment. Make sure you look at the "Raw" tab at some point.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...