|
I have 2 html menu.html and menu2.html,
and would like to swich one another using "onChange" in each form.
function pageCh works first time, but it doesn't 2nd time.
alert("menu2") does not pop up either.
javascript in menu.html
[HTML]
<script language="JavaScript" type="text/JavaScript">
<!--
function pageCh(sectionURL) {
parent.section.location.href = sectionURL;
if(sectionURL == "/forum/section02.xml") {
parent.menu.location.href = "menu2.html";
}
}
//-->
</script>
[/HTML]
form in menu.html
[HTML]
<form>
<select onChange="pageCh(this.value)">
<option value="/forum/section01.xml" selected>1/option>
<option value="/forum/section02.xml">2</option>
</select>
</form>
[/HTML]
javascript in menu2.html
[HTML]
<script language="JavaScript" type="text/JavaScript">
<!--
alert("menu2");
function pageCh(sectionURL) {
alert(sectionURL);
parent.section.location.href = sectionURL;
if(sectionURL == "/forum/section01.xml") {
parent.menu.location.href = "menu.html";
}
//-->
</script>
[/HTML]
form in menu2.html
[HTML]
<form>
<select onChange="pageCh(this.value)">
<option value="/forum/section02.xml" selected>2</option>
<option value="/forum/section01.xml">1</option>
</select>
</form>
[/HTML]
thanks
|
|
|
|
|
|
|
// |