Javascript弹出式IE错误

Javascript弹出式IE错误,javascript,internet-explorer,popup,window,Javascript,Internet Explorer,Popup,Window,我已经进入了一个新的职位,我的任务是清理已有的代码。我将发布一个Javascript函数,通过使用基本URL构建酒店预订,然后将变量传递到另一个站点 更清楚地说,此功能允许您访问站点A并在站点B上搜索酒店预订。此功能使这一点更加清晰 function buildReservationURL(){ var site = "http://ach.travel.yahoo.net/hotel/HotelCobrand.do?smls=Y&Service=YHOE&.intl=us&

我已经进入了一个新的职位,我的任务是清理已有的代码。我将发布一个Javascript函数,通过使用基本URL构建酒店预订,然后将变量传递到另一个站点

更清楚地说,此功能允许您访问站点A并在站点B上搜索酒店预订。此功能使这一点更加清晰

function buildReservationURL(){
  var site = "http://ach.travel.yahoo.net/hotel/HotelCobrand.do?smls=Y&Service=YHOE&.intl=us&.resform=YahooHotelsCity&";


 <!-- Variables Are Defined Here from Form Values //-->


  var finishedURL = site + "city=" + cityname + "&state=" + statename + "&dateLeavingDay=" + inDay + "&dateReturningDay=" + outDay + "&adults=" + adults + "&source=YX&distance=&hotelChain=&searchMode=city&cityCountryCode=us&&dateLeavingMonth=" + inMonth + "&dateReturningMonth=" + outMonth;
  NewWindow(finishedURL,'Yahoo Travel','780','580','yes','no','1');
}
函数buildReservationURL(){
变量站点=”http://ach.travel.yahoo.net/hotel/HotelCobrand.do?smls=Y&Service=YHOE&.intl=us&.resform=YahooHotelsCity&";
var finishedull=site+“city=“+cityname+”&state=“+statename+”&dateLeavingDay=“+inDay+”&dateReturningDay=“+outDay+”&dactors=“+outDay+”&source=YX&distance=&hotelChain=&searchMode=city&cityCountryCode=us&&dateleavingment=“+inMonth+”&dateReturningMonth=“+outMonth;
NewWindow(Finishedull、'Yahoo Travel'、'780'、'580'、'yes'、'no'、'1');
}

然而,我在IE中收到了一个错误,没有给出任何信息。该错误发生在创建窗口之前,因此我觉得该错误将位于创建该窗口和构建URL的函数中的某个位置。这在FireFox中确实可以很好地工作。有什么想法吗?

使用IE8的调试器并使用“出错时中断”。如果IE8中没有中断,请打开兼容性视图。它使用IE7 javascript引擎,同时仍为您提供IE8调试功能。

是否您使用的IE版本不支持窗口名中的空格?(“在您的示例中是Yahoo Travel”)

您可能希望编辑代码,直到实际问题发生的地方。这真是一团糟。不知道函数如何使这“更清晰”。我会关注NewWindow函数。这个函数的定义是什么?你说IE中的错误给出了“零信息”。严格来说,这可能不是真的。它可能提供很少的信息,但它可能会说些什么,对吗?IE对话框到底说了什么?IE对话框说的是“无效参数”。我相信错误在NewWindow行中,但我不确定它是什么。我为代码道歉,就像我说的,我介入了这件事。我只是不确定是什么阻止了这一切。根据一些研究,我认为为窗口定义的属性可能是原因。您能否显示
NewWindow
函数的源代码?这几乎可以肯定是错误所在。AFAIK-这会影响IE的所有版本(例如…,6,7,8)。如果有相同的错误,在删除窗口名称中的空格后,问题就解决了。谢谢
function NewWindow(mypage,myname,w,h,scroll, menu, res) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + 
    ', resizable=' + res + ', location=no, directories=no, status=yes, menubar=' + menu;
    win = window.open(mypage,myname,winprops);
    if(parseInt(navigator.appVersion) > 3){
        win.window.focus();
    }
}