当下拉菜单通过 YUI Change 事件更改时,我正在尝试加载 URL。我只想导航到那个 URL。
我进行了长时间的搜索。但是没有办法。
谢谢 :)
<select id="dropdown">
<option value="http://example.com/home">Home</option>
<option value="http://example.com/about">Abount</option>
</select>
Y.one("#dropdown").on("change", function() {
//'this' points to dropdown node
//so it's value is a value of selected option. Assume you keep new url there
document.location.href = this.get('value');
});