jquery - .submit() open two tabs instead of one -


("#preview").click(function() {      $("form").attr({action: "preview.php", target: "_blank"}).submit();   }); 

when click on <input type="button" id="preview" /> want submit preview other page. thing is, working jquery open 2 times same tab.

thank help

you try:

  $("#preview").click(function(e) {         e.stoppropagation();         $("form").attr({action: "preview.php", target: "_blank"}).submit();      }); 

edit:

i mean:

$("#preview").click(function(e) {      $("form").attr({action: "preview.php", target: "_blank"}).submit(); });  $("form").submit(function(e){      e.stoppropagation(); }); 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

tags - Jquery Mixitup plugin help prevent handlers being destroyed -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -