SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    0 Post(s)
    0 Thread(s)

    How to do a better form post with javascript?

    Good afternoon.
    We want to make more efficient internal form posts in a Web site have a lot of trafic. With internal posts I am talking about the information the user didn't introduce directly in this page, I mean, the information is used for the system. My boss told me search if is better use jquery or AJAX for that. By the way, I am learning jquery so please excuse me if I say some wrong think and please lets me know my mistake.
    I have been googling but I only saw how to do ajax's posts through jquery. What do you think is the better option?? Summarizing: we want many of the post happen in the user's computer. We will be really gratefull for any comment, suggestion, etc.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Sydney, NSW, Australia
    25 Post(s)
    1 Thread(s)
    You can either do ajax calls directly from JavaScript (see for some examples) or you can have JavaScript call jQuery and have the jQuery make the ajax call for you. Either way you are still using the same calls to the server, just that jQuery wraps the code for the call inside a function for you to save you having to write all the code for yourself. Once the code is written it will not matter which of the two you have chosen except that if you use jQuery only for that and don't make use of the rest of the library then you will have visitors downloading a big chunk of JavaScript in that jQuery library that the pages never use.
    Stephen J Chapman, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts