I have two functions in an external .js page:
createMenu(sel) {
document.write( "TEST1");
}
createFirstMenu (sel){
document.write( "TEST2");
}
I have another page that includes this javaScript. In this page I use <body
onload="createM enu('sel1');">:
<body onload="createM enu('sel1')">
<form name="sels" method="post" action="?page=j ubii">
Kategori:
<select name="sel1" id="sel1" onchange="creat eMenu('sel1','s el2');">
</select> &n bsp;   ;
<select name="sel2" id="sel2">
<option value="" selected[color=blue]
>-er- Vælg --</option>[/color]
</select>
<input name="search" type="text" id="search">
<input type="submit" name="Submit" value="Søg">
</form>
"TEST1" get printed when I open this page as expected.
But if I change onload to:
<body onload="createF irstMenu('sel1' )">
I don't get "TEST2" printed!
What are the explanation?
createMenu(sel) {
document.write( "TEST1");
}
createFirstMenu (sel){
document.write( "TEST2");
}
I have another page that includes this javaScript. In this page I use <body
onload="createM enu('sel1');">:
<body onload="createM enu('sel1')">
<form name="sels" method="post" action="?page=j ubii">
Kategori:
<select name="sel1" id="sel1" onchange="creat eMenu('sel1','s el2');">
</select> &n bsp;   ;
<select name="sel2" id="sel2">
<option value="" selected[color=blue]
>-er- Vælg --</option>[/color]
</select>
<input name="search" type="text" id="search">
<input type="submit" name="Submit" value="Søg">
</form>
"TEST1" get printed when I open this page as expected.
But if I change onload to:
<body onload="createF irstMenu('sel1' )">
I don't get "TEST2" printed!
What are the explanation?
Comment