showModalDialog 传值,刷新,后退 技巧
[ 2007-04-07 16:43:36 | 作者: admin ]
父窗口刷新...
阅读全文…
引用
var vReturn='';
var strFeature = 'dialogWidth:530px;dialogHeight:470px;status:0;scroll:1:0;help:0;';
vReturn=window.showModalDialog(strUrl,window,strFeature);
请注意:在第二个参数使用的是window,作用相当于把当前的父窗口当作对象传入到子窗口
在子窗口中使用父窗口的对象:window,但使用时要用dialogArguments引用父窗口对象。例如:
dialogArguments.location='other.asp'; //父窗跳转
dialogArguments.location.reload();//父窗刷新
window.close(); //子窗关闭
var strFeature = 'dialogWidth:530px;dialogHeight:470px;status:0;scroll:1:0;help:0;';
vReturn=window.showModalDialog(strUrl,window,strFeature);
请注意:在第二个参数使用的是window,作用相当于把当前的父窗口当作对象传入到子窗口
在子窗口中使用父窗口的对象:window,但使用时要用dialogArguments引用父窗口对象。例如:
dialogArguments.location='other.asp'; //父窗跳转
dialogArguments.location.reload();//父窗刷新
window.close(); //子窗关闭
阅读全文…
showModalDialog页面不能自动刷新问题
[ 2007-04-07 16:39:10 | 作者: admin ]
摘自: http://xiajx.spaces.live.com/blog/cns!11f54dd21fcd88ab!132.entry
将以下内容添加到页面的<head></head>标签内,即可实现showModalDialog的页面刷新和IE"后退"按钮无效功能。
<meta http-equiv="Pragma" content="no-cache">
<!-- Pragma content set to no-cache tells the browser not to cache the page
This may or may not work in IE -->
<meta http-equiv="expires" content="0">
<!-- Setting the page to expire at 0 means the page is immediately expired
...
阅读全文…
将以下内容添加到页面的<head></head>标签内,即可实现showModalDialog的页面刷新和IE"后退"按钮无效功能。
<meta http-equiv="Pragma" content="no-cache">
<!-- Pragma content set to no-cache tells the browser not to cache the page
This may or may not work in IE -->
<meta http-equiv="expires" content="0">
<!-- Setting the page to expire at 0 means the page is immediately expired
...
阅读全文…
showModalDialog 传递中文参数乱码,用escape()
[ 2007-04-07 16:33:25 | 作者: admin ]
asp.net页中 showModalDialog("PopForm.aspx?v=卡号") , 接受中文参数v是乱码????????
p.s. 使用Server.UrlEncode 依旧乱码
解决方法:
一、使用UTF-8
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
二、js编码
window.showModalDialog("PopForm.aspx?value="+ escape(‘卡号’) +"",...)
Javascript 的三个编码方法...
阅读全文…
p.s. 使用Server.UrlEncode 依旧乱码
解决方法:
一、使用UTF-8
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
二、js编码
window.showModalDialog("PopForm.aspx?value="+ escape(‘卡号’) +"",...)
Javascript 的三个编码方法
引用
escape() 方法:
采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编码的16进
采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编码的16进
阅读全文…
如果你的网页中有<a href=“#”> .......</a> 这样的连接,而且已经出现的滚动条,并且下拉了一些,那么当点击这个连接的时候就会返回页面顶部,很是讨厌。以下几中方法可以防止这个问题
1 将<a href=“#”> .......</a>
改为<a href=“javascript:;”> .......</a>
2 将<a href=“#”> .......</a>
改为<a href=“#” onclick="return false"> .......</a>
3 如果实在不需要一个连接,而只是想让浏览者把鼠标放在这里的时候让鼠标变成手
那么你也可以将........前的<a> 去掉,用<span style="cursor:hand">代替也可以
4 将<a href=“#”> .......</a>
...
阅读全文…
1 将<a href=“#”> .......</a>
改为<a href=“javascript:;”> .......</a>
2 将<a href=“#”> .......</a>
改为<a href=“#” onclick="return false"> .......</a>
3 如果实在不需要一个连接,而只是想让浏览者把鼠标放在这里的时候让鼠标变成手
那么你也可以将........前的<a> 去掉,用<span style="cursor:hand">代替也可以
4 将<a href=“#”> .......</a>
...
阅读全文…
利用js的cookie实现flash的轮换
[ 2007-03-07 18:01:12 | 作者: admin ]
<script language="javascript1.2">
<!--
var myCookie="" ;
//alert(myCookie);
myCookie = getCookie("myFlash");
//alert(myCookie);
if(myCookie==null){
myCookie = "1";
}else{
if(myCookie=="1"){
myCookie = "2";
}else{
myCookie = "1";
}
}
setCookie("myFlash",myCookie);
document.writeln("<object classid=\"clsid:D27CD...
阅读全文…
<!--
var myCookie="" ;
//alert(myCookie);
myCookie = getCookie("myFlash");
//alert(myCookie);
if(myCookie==null){
myCookie = "1";
}else{
if(myCookie=="1"){
myCookie = "2";
}else{
myCookie = "1";
}
}
setCookie("myFlash",myCookie);
document.writeln("<object classid=\"clsid:D27CD...
阅读全文…
ie 和 firefox对javascript的支持
[ 2007-03-06 10:35:44 | 作者: admin ]
是不是doesn't support this method?
以下以 IE 代替 Internet Explorer,以 MF 代替 Mozzila Firefox
1. document.form.item 问题
(1)现有问题:
现有代码中存在许多 document.formName.item("itemName") 这样的语句,不能在 MF 下运行
(2)解决方法:
改用 document.formName.elements["elementName"]
(3)其它
参见 2
2. 集合类对象问题
(1)现有问题:
现有代码中许多集合类对象取用时使用 (),IE 能接受,MF 不能。
(2)解决方法:
改用 [] 作为下标运算。如:document.forms("formName") 改为 document.forms["formName"]。
...
阅读全文…
以下以 IE 代替 Internet Explorer,以 MF 代替 Mozzila Firefox
1. document.form.item 问题
(1)现有问题:
现有代码中存在许多 document.formName.item("itemName") 这样的语句,不能在 MF 下运行
(2)解决方法:
改用 document.formName.elements["elementName"]
(3)其它
参见 2
2. 集合类对象问题
(1)现有问题:
现有代码中许多集合类对象取用时使用 (),IE 能接受,MF 不能。
(2)解决方法:
改用 [] 作为下标运算。如:document.forms("formName") 改为 document.forms["formName"]。
...
阅读全文…
javascript ,让你随意编辑网页
[ 2007-03-05 19:30:40 | 作者: admin ]
只要打开一个网站,然后在地址栏内打入:
程序代码
程序代码
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
javascript判断单选框
[ 2007-02-28 15:47:31 | 作者: admin ]
今天给论坛加个举报的小功能时遇到个radio判断问题,现在总结下:
<input name="QClass" type="radio" value="色情">色情
<input name="QClass" type="radio" value="涉政">涉政
<input name="QClass" type="radio" value="违法">违法
<input name="QClass" type="radio" value="毁谤">毁谤
<input name="QClass" type="radio" value="其他">其他
<input name="submit" type="submit" value=" 确 定 " ID="Submit1" onclick="return ChkFormRadio()">
......
[code][/code]...
阅读全文…
<input name="QClass" type="radio" value="色情">色情
<input name="QClass" type="radio" value="涉政">涉政
<input name="QClass" type="radio" value="违法">违法
<input name="QClass" type="radio" value="毁谤">毁谤
<input name="QClass" type="radio" value="其他">其他
<input name="submit" type="submit" value=" 确 定 " ID="Submit1" onclick="return ChkFormRadio()">
......
[code][/code]...
阅读全文…







