解决方案 »
- 关于jquery选择器的问题
- 怎样写这样一个函数
- 如果获得页面的高度并且滚动条滚动到新添加的内容呢?我这样写为什么无效
- JS有没有办法调用系统的右键菜单??
- 根据条件生成的input 为什么在JS中取其value的时候是undefined
- 下拉菜单被flash挡住了,请高手帮忙!
- 三层菜单的代码。
- 两个SELECT之间的互相控,大家帮个忙,我的新手。先谢了
- 关于页面A用window.showModalDialog脚本打开B页面,在页面A又用脚本关闭B页面的问题。
- Javascript中有什么函数可以获得字符串的中的某些字符,即类似于vbscript中的left,right等函数!
- 正则表达式求以1-8开头的六位数字
- 散分了!!!!!!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
var wenan="文字变量";
var wangzhi="http://share.baidu.com/static/web/img/imagesharepreview.jpg";function baidu(){
parent.document.getElementById('L1').innerHTML='<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more">分享到:</a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间">QQ空间</a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博">新浪微博</a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博">腾讯微博</a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网">人人网</a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信">微信</a></div>';
parent._bd_share_config = {
"common" : {
"bdSnsKey" : {
"tsina" : "123456",
"tqq" : "33333"
},
"bdText" : "文案",
"bdMini" : "2",
"bdMiniList" : false,
"bdPic" : "图片网址",
"bdStyle" : "0",
"bdSize" : "16"
},
"share" : {
"bdSize" : 16
},
"image" : {
"viewList" : [ "qzone", "tsina", "tqq", "renren", "weixin" ],
"viewText" : "分享到:",
"viewSize" : "16"
},
"selectShare" : {
"bdContainerClass" : null,
"bdSelectMiniList" : [ "qzone", "tsina", "tqq", "renren",
"weixin" ]
}
};
with (parent.document)
0[(getElementsByTagName("head")[0] || body)
.appendChild(createElement("script")).src = "http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion="
+ ~(-new Date() / 36e5)];
}
</script>
<button onclick="baidu()">加载</button>
</body>
</html>
原来eval()是画蛇添足!
而且,一直以为是转义符出的问题,但是仔细对照的你的代码,原来还应该在原有代码加上两个parent!!
我太菜了,系统学习js很有必要啊!