jquery - Ajax response passing parameters into URL bar (get?) -


Can anyone help me in debugging this simple function? I am using an onclick event to submit the form This function passes the $ id parameter.

  & lt; Input type = 'submit' name = 'submit' id = "submit" value = 'add' class = 'btn btn-success' onclic =' postform (& lt ;? php echo $ id;; & gt; ) ">  

In response to the problem occurs: if (reaction == 2). (Edit: Actually I have noticed that I am not receiving a resposne, But an auto refresh that populates the URL bar with GET parameter)

Reloading the page in the Chrome browser Because it should use location.reload (). However, when the parameters in the URL bar in Firefox / IE are passing, for example ..url / 500? Id = 500 $ other_field = 1000 reloading the page Instead of.

What could be the problem between the browser that happens? The function calls only the local .py script, so nothing is going to cross the domain.

  & lt; script & gt; function postform ($ id) {var isVali DForm = $ ("# form_id") is valid (); // check form is valid if (! IsValidForm) {return false; } Else {var id = $ id; // store id $ ('.btn'). Attr ("disabled", true); // disable button // wait popup code $ BlockUI ({CSS: {border: 'none', padding: '25px', background color: '# 111111', 'WebCat-boundary-radius':' 10px ',' moz-border-radius': ' 10px ', ambiguity: .5, color:' #fff '}}); $ .ajax ({type: 'post', url: 'xxx.php', data: $ ('# form_id'). Serialize (), success: function (feedback) {if (response == 1) {warning ( "Script executed successfully."); Window.location.href = "/ xxx /" + id;} and if (response == 2) {warning ("failed to execute script"); location.reload ();} }}); } // end else} // end function  


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -