Ajax回调弹窗
我有一个 Ajax 回调函数,它将加载一个 html 文件并在弹出窗口中弹出该 HTMl 文件的内容。
到目前为止它有效,但是,我想摆脱弹出窗口中的位置栏。 这是我的代码
函数_checkPopUpUpdate() { var 回调=新对象(); 回调.成功=this.onExternalSuccess; 回调.failure=this.onExternalFailure; YAHOO.util.Connect.asyncRequest('GET','/ci/ajaxCustom/ajaxCheckPopupUpdate',callback); };
函数 onExternalSuccess (o){
if(o.responseText!==未定义) { var str=o.responseText; //document.getElementById('updateContent').innerHTML=str; if(str !== 'no update') // 然后弹出。 { L=屏幕.宽度-200; T=屏幕高度; **popup = window.open(str,“”,“alwaysRaished =是,状态=否,工具栏=否,位置=否,菜单栏=否,目录=否,可调整大小=否,滚动条=否,高度= 80,宽度=210,左=“+L+”,顶部=“+T);** 对于 (i=0;i<200;i++) { T=T-1; popup.moveTo(L,T); } } } };
函数 onExternalFailure (o) { 警报(“失败”); };
所以,我的位置= 0,我认为它应该是正确的。但我仍然在弹出窗口中看到位置栏。
I have an Ajax callback function, which will load a html file and pop up the content of this HTMl file in a pop up window.
It works so far, however, i want to get rid of the location bar in the pop up window.
Here is my code
function _checkPopUpUpdate() {
var callback=new Object();
callback.success=this.onExternalSuccess;
callback.failure=this.onExternalFailure;
YAHOO.util.Connect.asyncRequest('GET','/ci/ajaxCustom/ajaxCheckPopupUpdate',callback);
};
function onExternalSuccess (o){
if(o.responseText!==undefined) { var str=o.responseText; //document.getElementById('updateContent').innerHTML=str; if(str !== 'no update') // Then pop up. { L=screen.width-200; T=screen.height; **popup=window.open(str,"","alwaysRaised=yes,status=no,toolbar=no,location=no,menubar=no,directories=no,resizable=no,scrollbars=no,height=80,width=210,left="+L+",top="+T);** for (i=0;i<200;i++) { T=T-1; popup.moveTo(L,T); } } } };
function onExternalFailure (o) {
alert("fail"); };
So, i have the location = 0, which i think it should correct. But i still get the location bar in my pop up window.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有些浏览器不允许您删除它。某些浏览器具有禁止删除它的设置。没有可靠的方法来删除地址栏。您可以在这里测试各种浏览器: http://www.quirksmode.org/js/popup.html
Some browsers don't let you remove it. Some browsers have a setting that will disable removing it. Theres no reliable way to remove the location bar. You can test various browsers here: http://www.quirksmode.org/js/popup.html