iframe 里的src传递参数有关问题
iframe 里的src传递参数问题
先贴上代码:
现在的需求是通过点击分割线上方div的不同图片链接 传递不同的内容到下方div的iframe中的src中的参数 ptopic=%E9%85%92%E7%BE%8E%E7%BD%91 即ptopic是动态的值.
要怎么做,js可以实现吗 ?
在线,等答案
------解决方案--------------------
<img src="http://www.wineimg.com/userfiles/image/2013/01/20/SuperStar_24.jpg" width="131" height="35" alt="AAA" onclick="dd.call(this);" />
<iframe id='oframe' width="100%" height="500" frameborder="0" scrolling="no" src="http://widget.weibo.com/livestream/listlive.php?language=zh_cn&width=0&height=500&uid=&skin=1&refer=1&appkey=&pic=0&titlebar=1&border=1&publish=1&atalk=1&recomm=0&at=0&atopic=&ptopic=%E9%85%92%E7%BE%8E%E7%BD%91&dpc=1">
function dd(){
var id = window.dialogArguments;
var url = "http://widget.weibo.com/livestream/listlive.php?language=zh_cn&width=0&height=500&uid=&skin=1&refer=1&appkey=&pic=0&titlebar=1&border=1&publish=1&atalk=1&recomm=0&at=0&atopic=" + "&ptopic="+this.alt;
先贴上代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wb="http://open.weibo.com/wb">
<head>
<title>test.html</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=816804488" type="text/javascript" charset="utf-8"></script>
</head>
<body>
This is my test page. <br>
<div>
<a href=#>
<img src="http://www.wineimg.com/userfiles/image/2013/01/20/SuperStar_24.jpg" width="131" height="35" />
</a>
<a href=#>
<img src="http://www.wineimg.com/userfiles/image/2013/01/20/SuperStar_24.jpg" width="131" height="35" />
</a>
<a href=#>
<img src="http://www.wineimg.com/userfiles/image/2013/01/20/SuperStar_24.jpg" width="131" height="35" />
</a>
</div>
===============================================分割线=========================================================
<div class="contimg">
<a name="result"></a>
<iframe width="100%" height="500" frameborder="0" scrolling="no" src="http://widget.weibo.com/livestream/listlive.php?language=zh_cn&width=0&height=500&uid=&skin=1&refer=1&appkey=&pic=0&titlebar=1&border=1&publish=1&atalk=1&recomm=0&at=0&atopic=&ptopic=%E9%85%92%E7%BE%8E%E7%BD%91&dpc=1">
</iframe>
</div>
</body>
</html>
现在的需求是通过点击分割线上方div的不同图片链接 传递不同的内容到下方div的iframe中的src中的参数 ptopic=%E9%85%92%E7%BE%8E%E7%BD%91 即ptopic是动态的值.
要怎么做,js可以实现吗 ?
在线,等答案
javascript
iframe
jsp
ajax
div
------解决方案--------------------
<img src="http://www.wineimg.com/userfiles/image/2013/01/20/SuperStar_24.jpg" width="131" height="35" alt="AAA" onclick="dd.call(this);" />
<iframe id='oframe' width="100%" height="500" frameborder="0" scrolling="no" src="http://widget.weibo.com/livestream/listlive.php?language=zh_cn&width=0&height=500&uid=&skin=1&refer=1&appkey=&pic=0&titlebar=1&border=1&publish=1&atalk=1&recomm=0&at=0&atopic=&ptopic=%E9%85%92%E7%BE%8E%E7%BD%91&dpc=1">
function dd(){
var id = window.dialogArguments;
var url = "http://widget.weibo.com/livestream/listlive.php?language=zh_cn&width=0&height=500&uid=&skin=1&refer=1&appkey=&pic=0&titlebar=1&border=1&publish=1&atalk=1&recomm=0&at=0&atopic=" + "&ptopic="+this.alt;