javascript - Replace the "click" to "onload" -


how can replace "click" in code click when page load "onload"

$(document).ready(function() { $("#submit").click(function() {     request();     return false; });  $("#website-form input").keypress(function(e) {     if (e.keycode == 13) {         e.preventdefault();         request();         return false;     } }); 

});

i try this:

$("#submit").trigger('click')(function() { 

but got error:

uncaught typeerror: object not function  

please help

$("#submit").trigger('click')(function() { invalid statement. $("#submit").trigger('click') returns jquery object referencing #submit element, not function reason error.

you need $("#submit").trigger('click') manually trigger click handler


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -