开发者

Submitting with jquery

I would like to learn how these websites are validating data with PHP. For instance you go to facebooks page and view the source code there is no form acti开发者_StackOverflow社区on supplied. Ok I understand they are using Javascript in some manner to post data towards PHP but can I do something similar with jquery? Are the submit() and Post() functions that I should learn in depth to achieve the results. Could some one shed some light how these websites are doing all this or is it just Ajax? Thanks help is much appreciated and if there is some tutorial you would recommend please do tell!


To answer your title issue, an easy way to post forms with ajax is the form plugin:

http://jquery.malsup.com/form/

It's veery easy to use. Just do:

   $(document).ready(function() { 
       $('form').ajaxForm(function() { 
          alert("Your form has been submitted!!"); //Put your logic here
       }); 
   });

Hope this helps. Cheers


If you want to know what http requests are being made on submits or javascript calls etc - install some packet sniffing software. Like Fiddler or Wireshark.

Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data


Yes, it's AJAX.

Yes, you should look up .post.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜