jQuery form submission. Stopping page refresh only works in newest browsers -
Use jQuery 1.4 to do this.
To add a form to body tags, submit form ('& lt; form name = "frmSample" id = "frmSample"> gt; & lt; input class = "" btn "type =" "Value =" sign up ">> ');});
I am using the following to submit the form: Live ('submit', function () {Var formdata = $ (this) .serialize (); $ .ajax ({type: 'POST') , Url: 'http://www.example.com/Values.jsp', data: formdata, success: function () {submit_success ();}})) return false}};
This works fine on the latest browsers (Firefox 3.5, Safari 4) Once I go below FF 3.0 and below or IE 7 and go down this stops.
I'm just a little bit stuck. I'm searching for a good bit. And I have been able to mention just a few other things except false false phenomena or incident.
To see if I'm missing something short here, or I'm completely Going in the wrong direction.
I Go one step further than Stoppopageshn:
$ ( '# frmSample'). Live ('submit', function (e) {stopEvent (e); .... etc ... etc
and code for stop event:
< Code> function stop event (event) {event.preventDefault (); event.stopPropagation (); if ($ .browser.msie) {event.originalEvent.keyCode = 0; Event.originalEvent.cancelBubble = true; event.originalEvent.returnValue
From here:
Return value and stop default () methods
This is our need - But we can not rely on the wrong method of returning to stop the default action. Wing leaves this code function Ga - Therefore, if the function is more to do this, then this code can not be used. In the situations in which I encounter, they return false, but in some areas we need to be more strict.
For more information, type the following in Google:
PreventDefault StopPropagation cancelBubble
Comments
Post a Comment