您的位置:首页 > 移动开发 > Objective-C

[-小技巧-] 不被拦截的弹出窗口,同时推荐一个好站点~

2006-10-31 18:44 639 查看
1. 弹出窗口:

如下代码在IE6SP1,GOOGLE工具条(开启拦截弹出窗口),测试通过

default.htm

以下是代码片段:

 

var test = window.showModalDialog(’openwindow.htm’,’OpenWindow’,’’);

window.opener = null;

window.close();

 

openwindow.htm

 

function openFullScreen(){

window.open("default1.htm","ful
l","fullscreen");//Default1.htm文件为你要弹出的窗口文件

window.returnValue = "TEST";

window.close();

}

openFullScreen();
----------------------------------------

2. 查API挺方便的网站:http://www.gotapi.com/ 

----------------------------------------

补充:showdialog传值~

主页面中:
…………………………
<form name="printTextForm" jwcid="printTextForm">
  <tr>
  <td colspan="2" align="center"><input name="PrintText2" jwcid="printtext" onClick=NewWindow()/></td>
  <td colspan="2"><input id="PagePrompt" jwcid="pageprompt"/></td>
  </tr>
  </form>
…………………………
function NewWindow()
{
    var obj = new Object();
 obj.headpage = newAccountForm.HeadPageText.value;
    obj.text = newAccountForm.TranxDataText.value.substr(3);
 window.showModalDialog("printheadpage.html",obj,"dialogWidth=400px;dialogHeight=200px");
}
…………………………
在打开的printheadpage.html中,用脚本语言
var obj = window.dialogArguments;
KdbKbdControl1.cPrintText = obj.text;
s = obj.headpage;
……………………………………
就取得了传递的对象
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息