jQuery - how to execute .load() on http post?

Haundenda

New Member
In my application, I have a piece of code that "catches" all the clicks on an anchor, and loads it into my page:\[code\]$("a").live("click", function () { var src = http://stackoverflow.com/questions/15746253/$(this).attr("href"); if ($(this).attr("target") === "_blank") return true; $("#myPage").load(src + " #myPage"); return false;});\[/code\]Now this works on all anchor tags. How can I make all my POST requests (sending forms data) behave like that?Edit: As Kevin said, I tried using .post, but it doesn't work for me, what did I do wrong? Here's the code:\[code\]$("form").post("submit", function () { var src = http://stackoverflow.com/questions/15746253/$(this).attr("action"); $("#myPage").load(src + " #myPage"); return false;});\[/code\]
 
Back
Top