hi
i trying to find how can we get the page load event in moodle.
what want is i create a one page that using moodle api like print_header,print_footer etc.
when this page load i want to call one javascript function named pageload()
so how can i do this.
i found that if i write in html page like this
<body onclick="pageload()">
then it will work but in moodle how can i do it?
In your PHP code somewhere do
require_js('yui_dom-event');
require_js('myscripts.js');
Then in myscripts.js, do something like
function init_my_feature() {
// Whatever.
}
YAHOO.util.Event.onDOMReady(init_my_feature);
Development:JavaScript_guidelines and
http://developer.yahoo.com/yui/event/ should help you understand this.
require_js('yui_dom-event');
require_js('myscripts.js');
Then in myscripts.js, do something like
function init_my_feature() {
// Whatever.
}
YAHOO.util.Event.onDOMReady(init_my_feature);
Development:JavaScript_guidelines and
http://developer.yahoo.com/yui/event/ should help you understand this.