Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/457.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript window.open无效参数错误_Javascript - Fatal编程技术网

Javascript window.open无效参数错误

Javascript window.open无效参数错误,javascript,Javascript,因此,每当我尝试运行此脚本时,都会出现无效参数错误。错误发生在window.open(url、名称、功能)不幸的是,我不知道如何修复此问题。有什么想法吗 Common-Utilities.js(问题出在哪里-第4行) openPopUp.js function openPopup(url, width, height) { if (width == -1) width = 710; if (height == -1) height = 500; var left

因此,每当我尝试运行此脚本时,都会出现无效参数错误。错误发生在
window.open(url、名称、功能)不幸的是,我不知道如何修复此问题。有什么想法吗

Common-Utilities.js(问题出在哪里-第4行)

openPopUp.js

function openPopup(url, width, height) 
{   
    if (width == -1) width = 710;
    if (height == -1) height = 500;

    var left = (window.screen.availWidth - width) / 2;
    var top = (window.screen.availHeight - height) / 2;

    if (window.screenLeft>window.screen.availWidth)
    {
        left = left + window.screen.availWidth;
    }

    // open url in new browser window
    var handle = wm.open(url, 'location=0, menubar=0, resizable=1, scrollbars=1, status=0, toolbar=0, width=' + width + 'px, height=' + height + 'px, top=' + top + 'px , left=' + left + 'px');

    //tile the windows so user can tell a new window has been opened
    if (document.body.clientHeight==height)
    {   
        var metricTop=10;
        var metricLeft=10;
        var thisTop=self.screenTop+metricTop;
        var thisLeft=self.screenLeft+metricLeft;
        if (thisTop<0) thisTop=0;
        if (thisLeft<0) thisLeft=0;
        handle.moveTo(thisLeft, thisTop);
    }

}

function popOutOrIn(url, title, width, height, popOut) {
    if (width == -1) width = 710;
    if (height == -1) height = 500;

    if (popOut === 'True') {
        openPopup(url, width, height)
    }
    else {
        window.top.popUpRadWindow(url, title, width, height);
    }
}
函数openPopup(url、宽度、高度)
{   
如果(宽度==-1)宽度=710;
如果(高度==-1)高度=500;
var left=(window.screen.availWidth-width)/2;
var top=(window.screen.availHeight-高度)/2;
if(window.screenlight>window.screen.availWidth)
{
左=左+window.screen.availWidth;
}
//在新浏览器窗口中打开url
var handle=wm.open(url,'location=0,menubar=0,resizeable=1,scrollbars=1,status=0,toolbar=0,width='+width+'px,height='+height+'px,top='+top+'px,left='+left+'px');
//平铺窗口,以便用户可以判断新窗口已打开
if(document.body.clientHeight==高度)
{   
var-metricTop=10;
var metricLeft=10;
var thisTop=self.screenTop+metricTop;
var thisLeft=self.screenLeft+metricLeft;

如果(thisTop我们有了代码…下面是修复程序:

 var handle = wm.open(url,'I want a name!', 'location=0, menubar=0, resizable=1, scrollbars=1, status=0, toolbar=0, width=' + width + 'px, height=' + height + 'px, top=' + top + 'px , left=' + left + 'px');

我们有代码…这里是修复程序:

 var handle = wm.open(url,'I want a name!', 'location=0, menubar=0, resizable=1, scrollbars=1, status=0, toolbar=0, width=' + width + 'px, height=' + height + 'px, top=' + top + 'px , left=' + left + 'px');

name参数中不能有空格,因此正则表达式需要
\s

this.getName = function (url) {
    name = getAbsolutePath(url);
    return name.replace(/[:.\+\/\?\&\=\#\%\-\s]/g, "_").toLowerCase();
};

name参数中不能有空格,因此正则表达式需要
\s

this.getName = function (url) {
    name = getAbsolutePath(url);
    return name.replace(/[:.\+\/\?\&\=\#\%\-\s]/g, "_").toLowerCase();
};

错误是什么?您如何调用此函数?url、名称和功能的值是什么?window.open不是一个jQuery函数--它是一个Javascript。我实际上没有调用此函数,这是我常用的实用程序。我发布了调用新窗口的函数。错误是什么?您如何调用此函数?值是什么它不是一个jQuery函数——它是一个javascripti。我实际上并没有调用这个函数,这是我常用的实用程序。我发布了一个调用新窗口的函数。它没有修复任何东西(或破坏任何有利的方面)。它没有修复任何东西(或破坏任何有利的方面)。