[英]How to retain the dropdown and their selection after pressing back in browser
Having 2 dropdowns based on one drop down other will populate and open webpage. 根据一个下拉菜单中的另一个下拉菜单,有2个下拉菜单将填充并打开网页。 But when i press back in the webpage the 2nd dropdown is not seen.
但是,当我在网页中按回时,将看不到第二个下拉菜单。
The source below is the java code which i used. 下面的源是我使用的Java代码。 Please tell me how to use the location.hash property in this code to retain the dropdown.
请告诉我如何在此代码中使用location.hash属性来保留下拉列表。
I tried using the location.hash and location.href but it's not working. 我尝试使用location.hash和location.href,但无法正常工作。 Please help me resolve my problem.
请帮助我解决我的问题。
<script language="javascript">
var selectmenu=document.getElementById("mymenu")
selectmenu.onchange=function()
{
var chosenoption=this.options[this.selectedIndex]
if (chosenoption.value!="nothing")
{
window.open(chosenoption.value,"_parent")
}
}
</script>
I would say, the design not very good. 我会说,设计不是很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.