[英]Loading content based on a Select option
I have a screen that loads content dynamically. 我有一个可以动态加载内容的屏幕。 I'm using Jquery load();
我正在使用Jquery load(); method to fetch data on the same screen.
在同一屏幕上获取数据的方法。
Now I have a combo box and this will control the content of the screen. 现在,我有了一个组合框,它将控制屏幕的内容。 For example: If I select a option on the drop-down, loads a file...
例如:如果我在下拉菜单中选择一个选项,则加载文件...
The combo-box is: 组合框是:
<select class="stock_combo">
<option value="select">Select a corridor</option>
<option value="1">A1</option>
<option value="2">A2</option>
<option value="3">A3</option>
</select>
A selected option, should do this: 选定的选项应执行以下操作:
<script>
$(document).ready(function(){
$(".dangerarea").load("dialogs/stock/corridor1.php");
});
</script>
<div class="dangerarea">
[ .php filles will be loaded here. ]
</div>
How can I put this Javascript on each option to load it immediately? 如何将这个Javascript放在每个选项上以立即加载?
Any help will be strongly appreciated. 任何帮助将不胜感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.