开发者

Javascript Popup IE Error

开发者 https://www.devze.com 2022-12-08 15:54 出处:网络
I\'ve s开发者_如何学JAVAtepped into a new position and am tasked with cleaning up pre-existing code.I will be posting a Javascript function for building hotel reservations by using a base URL and then

I've s开发者_如何学JAVAtepped into a new position and am tasked with cleaning up pre-existing code. I will be posting a Javascript function for building hotel reservations by using a base URL and then carrying over variables to the other site.

More clearly, this function allows your to access Site A and search for hotel reservations on Site B. The function makes this even clearer.

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');
}

However, I am receiving an error in IE that gives zero information. The error occurs prior to a window being created so I feel the error would reside somewhere in the function where it is created and the URL is built. This does work fine in FireFox. Any ideas?


Could it be you're using a version of IE that doesn't support spaces in the window name? ("Yahoo Travel" in your example.)


Use IE8's debugger and use "break on error." If it doesn't break in IE8, turn on compatibility view. That uses the IE7 javascript engine while still giving you IE8 debugging facilities.


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();
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消