jquery - How is the correct syntax to call a function in the document.ready() section? -
i'm pretty sure answer question not difficult:
i want call function in $(document).ready(function() section of page. function called clicking on button. this:
<button  value="call function" action="#{functionclass.functionmethod}"/> the function call via button works fine, how 'translate' 'jquery-style'?
to more precise: want call method when page loaded, not when button clicked.
$(document).ready(function() {        einstiegsseitecontroller.loadtranslation();         });  does not work.
call function in body of anonymous function() of on, not ready:
$(document).on( 'click', '.someclass', function(){     functionclass.functionmethod(); }); ready events should happen once dom has loaded. don't need event, need click event. using in on i've shown work dynamic dom (such when changing divs ajax).
edit: considering edit question, function can called on dom load follows:
$(document).ready(function(){     functionclass.functionmethod(); }); 
Comments
Post a Comment