0

Possible Duplicate:
How to make an ajax call without jquery?

I have a function where I need to make an update to my database using an ajax call. For speed reasons, I would prefer it if I didn't have to include the jquery source file on this page and therefore use the $.ajax function to perform my post request to the php file, although this would make performing the ajax call via POST a lot easier.

I have seen on here how to do this using the GET method but have not found any help for doing a non-jquery ajax call using the POST method. Since this call will make changes to my database, I do not want to use the GET method.

UPDATE:

Going the jquery route: The actual task performed is lower priority to loading the rest of the page. Is there any way I can guarantee that the ajax call (including loading jquery) is the very last javascript thing to go off as the page loads?

Community
  • 1
  • 1
Rafie
  • 569
  • 1
  • 5
  • 10
  • 4
    Have you googled it? Should be really easy to find an example. – Pitchinnate Nov 07 '12 at 21:47
  • I did not think that the jQuery source file would slow down a site that much. Maybe an alternative is to use the Google one so that it may be cached from going to another site that referenced it? – JoeFletch Nov 07 '12 at 21:48
  • 2
    If you Google for "ajax javascript -jquery", you'll find 100s of tutorials. Keep in mind that doing such thing is not as easy as using a library (JQuery or other) because it's browser-dependent (i.e. you have to write different code for different browsers ... mainly IE vs. everything else). – Aziz Nov 07 '12 at 21:49
  • 1
    jQuery 1.8.2 gzipped and minified is roughly 30KB... I'd say it's worth the AJAX abstraction (especially considering cross-browser issues). – Matthew Blancarte Nov 07 '12 at 21:50
  • Yeah, I already use the google cdn, gzipped, and minified version of jquery, I was just curious if I could make gains in speed before trying the easy route. – Rafie Nov 07 '12 at 21:59
  • The actual task performed is lower priority to loading the rest of the page. Is there any way I can guarantee that the ajax call (including loading jquery) is the very last javascript thing to go off as the page loads? – Rafie Nov 07 '12 at 22:01

0 Answers0