IE Error Popup Javascript

I have entered a new position and have been tasked with cleaning up pre-existing code. I will be hosting a Javascript function to create hotel rooms using the base url and then transfer the variables to another site.

It is clearer that this feature allows you to access Site A and search for hotels on Site B. The feature 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 getting an error in IE that gives zero information. The error occurs before the window is created, so I feel like the error will be somewhere in the function it was created in and the url is generated. This works great in FireFox. Any ideas?

+2


source to share


3 answers


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



+3


source


Use IE8 debugger and use "break on error". If it doesn't break in IE8, enable compatibility view. This uses IE7's javascript engine, still giving you IE8 debugging tools.



+3


source


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

      

+1


source







All Articles