jQuery和iFrame更新 [英] Jquery and iFrame update

查看:44
本文介绍了jQuery和iFrame更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个具有下拉菜单和iframe的页面,以便iframe的位置将根据下拉菜单中的url进行更改.使jquery更新iframe网址的正确语法是什么?

I want to create a page that has a dropdown and an iframe, so that the iframe location will change based on the url in the dropdown. What is the correct syntax to get jquery to update the iframe's url?

谢谢

推荐答案

我认为这会起作用:

$('#dropdownid').bind('change', function() {
    $('#iframeid').attr('src', $(this).val());
});

这篇关于jQuery和iFrame更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆