js疑难杂症 引用:Dialog.js文件,弹出窗口单独运行的时候正常,嵌入frameset中就提示:var bgdiv = pw.$("_DialogBGDiv"); 对象不支持此属性方法 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 光这样看是无法解释出来的了,最好上代码以及使用什么框架,还有是在什么时候执行上面那段代码都解释清楚。。一般来说遇到这种情况就需要考虑清楚IE里iframe其他网页会改变被嵌入网页的dom,你从这个角度去考虑问题试试看吧。 这是:引用的JS文件:http://www.websjy.com/club/websjy_index/41/Dialog.jshtml引用这个文件,调用里面的函数,弹出窗口。如果单独运行这个页面完全可以,但是把这个页面嵌入到framset中,就是提示js错误。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>浏览器)</title><style>body {background: #ffffff; color: #444;}a{ color: #09d; text-decoration: none; border: 0; background-color: transparent;}body,div,q,iframe,form,h5{ margin: 0; padding: 0;}img,fieldset { border: none 0; }body,td,textarea { word-break: break-all; word-wrap: break-word; line-height:1.5;}body,input,textarea,select,button { margin: 0; font-size: 12px; font-family: Tahoma, SimSun, sans-serif;}div,p,table,th,td { font-size:1em; font-family:inherit; line-height:inherit;}h5{ font-size:12px;}</style><script type="text/javascript" src="http://www.websjy.com/club/websjy_index/41/Dialog.js"></script><script type="text/javascript">function zOpen(){ var diag = new Dialog("Diag2"); diag.Width = 900; diag.Height = 400; diag.Title = "弹出窗口示例"; diag.URL = "http://www.16sucai.com/"; diag.OKEvent = zAlert;//点击确定后调用的方法 diag.show();}function zAlert(){ Dialog.alert("你点击了一个按钮");}function zConfirm(){ Dialog.confirm('警告:您确认要XXOO吗?',function(){Dialog.alert("yeah,周末到了,正是好时候");});}function al(){ alert(top.location);}</script></head><body><input type="button" value="弹出新窗口" onclick="zOpen()" /></body></html>等待解决啊,急死了 pw.$pw 是什么东西$哪来的自己调试一下 zOpen() 函数里面的写法是不是有问题,你测测 用firebug看看哪一步走不下去了 就是到:var bgdiv = pw.$("_DialogBGDiv"); 报:对象不支持此属性方法错误 $E.getTopLevelWindow = function(){ var pw = window; while(pw!=pw.parent){//如果存在框架 则获取顶层框架的WINDOW对象 pw = pw.parent; } return pw;}Dialog.prototype.show = function(){ var pw = $E.getTopLevelWindow();//存在框架 PW是顶层框架的WINDOW对象var bgdiv = pw.$("_DialogBGDiv");//顶层框架页面没有加载这个脚本文件 所以不存在$方法,所以报错不知道为什么这么写 我没看懂 求一款开源!免费。的web前端UI框架。最好是基于jquery的 关于body的问题 easyui插件treegrid分页问题 求两个正则表达式 在线等 好使就结贴 如何用鼠标双击获取到双击的对象,并把对象传值到打开的窗体? 初学者的问题 请指教 别鄙视.. 请教JS输出EL表达式 Excel如何实现在IFRAME中打开,并且打开时为打印预览状态 如何把用户名和密码写入超链接中? 欢迎两位斑竹cpplus、beyond_xiruo,希望瞻仰两位的风采! 为什么调用不了这个函数,,属于jQuery 求把一段jquery程序改写成可调用的形式
html引用这个文件,调用里面的函数,弹出窗口。
如果单独运行这个页面完全可以,但是把这个页面嵌入到framset中,就是提示js错误。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>浏览器)</title>
<style>
body {background: #ffffff; color: #444;}
a{ color: #09d; text-decoration: none; border: 0; background-color: transparent;}
body,div,q,iframe,form,h5{ margin: 0; padding: 0;}
img,fieldset { border: none 0; }
body,td,textarea { word-break: break-all; word-wrap: break-word; line-height:1.5;}
body,input,textarea,select,button { margin: 0; font-size: 12px; font-family: Tahoma, SimSun, sans-serif;}
div,p,table,th,td { font-size:1em; font-family:inherit; line-height:inherit;}
h5{ font-size:12px;}
</style>
<script type="text/javascript" src="http://www.websjy.com/club/websjy_index/41/Dialog.js"></script>
<script type="text/javascript">
function zOpen(){
var diag = new Dialog("Diag2");
diag.Width = 900;
diag.Height = 400;
diag.Title = "弹出窗口示例";
diag.URL = "http://www.16sucai.com/";
diag.OKEvent = zAlert;//点击确定后调用的方法
diag.show();
}
function zAlert(){
Dialog.alert("你点击了一个按钮");
}
function zConfirm(){
Dialog.confirm('警告:您确认要XXOO吗?',function(){Dialog.alert("yeah,周末到了,正是好时候");});
}function al()
{
alert(top.location);
}
</script>
</head>
<body>
<input type="button" value="弹出新窗口" onclick="zOpen()" />
</body>
</html>
等待解决啊,急死了
pw 是什么东西
$哪来的自己调试一下
var bgdiv = pw.$("_DialogBGDiv"); 报:对象不支持此属性方法错误
var pw = window;
while(pw!=pw.parent){//如果存在框架 则获取顶层框架的WINDOW对象
pw = pw.parent;
}
return pw;
}Dialog.prototype.show = function(){
var pw = $E.getTopLevelWindow();//存在框架 PW是顶层框架的WINDOW对象var bgdiv = pw.$("_DialogBGDiv");//顶层框架页面没有加载这个脚本文件 所以不存在$方法,所以报错不知道为什么这么写 我没看懂