How can I load the body
<body Xonload="javascript:something">
instead of the standard body
<body>
into a page of a moodle module?
I only have to write a new page from scratch or does it exist a trick?
Thank you in advance.
Sorry, the X before the onload was added by the editor, not by me.
Doesn't this thread from the last few days ask and answer pretty much exactly this question?
Ciao Tim and thanks for your reply.
I read the thread you suggested but... I believe I am looking for something different.
Maybe because of my deep incompetence but, what I understand is that by adding something like
I add libraries to the head of the page.
What I am looking for, instead, is a way to customize the body load.
I want to automatically submit a form written in the page.
I want to have something like:
Are they the same problem?
Thank you in advance.
I read the thread you suggested but... I believe I am looking for something different.
Maybe because of my deep incompetence but, what I understand is that by adding something like
require_js('one of the magic words');
I add libraries to the head of the page.
What I am looking for, instead, is a way to customize the body load.
<body Xonload="execute my js">.
I want to automatically submit a form written in the page.
I want to have something like:
<body Xonload="javascript:document.forms.myform.submit();">
Are they the same problem?
Thank you in advance.
<body Xonload="execute my js"> is not really sensible, because if two things on the page want to do that, you are stuck.
That is why require_js(array('yui-yahoo', 'yui-event'); then YAHOO.util.Event.onDOMReady(WeekDays) in any .js file is a much better solution. Which is exactly the advice we got to by the end of the other thread.
Thanks Tim. It is difficult for me to understand YAHOO.util.Event.onDOMReady.
I have to go to read carefully the onDOMready documentation in http://developer.yahoo.com/yui/event/#ondomready
I didn't know I needed it.
I still even ignore what DOM stands for!!!
Thanks for your support.
I have to go to read carefully the onDOMready documentation in http://developer.yahoo.com/yui/event/#ondomready
I didn't know I needed it.
I still even ignore what DOM stands for!!!
Thanks for your support.