The dangers of using anchors instead of I / O

I am currently working on a site where I use bindings to submit forms using jQuery as follows:

$("a[title=submit]").click( function(){
      $(this).parents("form").submit();
      });
});

However, I read that using links in this way is bad practice, safe.

Does anyone know what the problem is?

+3
source share
3 answers

This is bad practice, but the “dangers” have nothing to do with security.

script -assisted , , JavaScript ( , JS - ), link , " " " ", .

input type="submit". , - , , :

input.linklike {
    color: blue; text-decoration: underline;
    border: none; padding: 0;
    width: auto; overflow: visible; /* hack for IE */
}
+4

, html/js/css Firebug . , ().

+4

, .

Javascript ( ), script, post-by-javascript script.

, - , javascript . , html, jQuery, . , javascript , -, ,

+1

Source: https://habr.com/ru/post/1728310/


All Articles