Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2011
    Posts
    80
    Thanks
    13
    Thanked 0 Times in 0 Posts

    [SOLVED] Bug testing in IE8 - invalid argument error

    Hi,

    So I'm testing my webpage in IE8. In firefox it looks and runs greag, but in IE 8, one issue I'm having is this: I have a button that opens a popup window. Works fine in Firefox, but I get 'invalid argument' error in IE8 and the window does not open. I've enabled at a whim some scripting things in the Internet Options hoping that would resolve the issue, but not so. Here's the code. The "invalid argument" occurs on the window.open call.
    Code:
    function open_report() 
    {
    	createURL();
    	var report_vars = created_URL;
    	report_vars = report_vars.substr(69);
    	report_array = report_vars.split('=');
    	var from_d = report_array[2].substr(0,10);
    	var to_d = report_array[3].substr(0,10);
    	window.open('detailedreport.shtml' + report_vars, 'My Site | Detailed Report - ' + from_d + ' to ' + to_d, 'title=yes, status=no, toolbar=no, location=no, menubar=no, scrollbars=yes, modal=yes, alwaysRaised=yes, width=' + window.outerWidth / 1.1 + ', height=' + window.outerHeight);
    }
    In addition, is there any way to have that tile I've given it, "my Site..." appear in the window header? Right now it's not appearing at all in either browser.

    Thanks for reading!
    Last edited by kberry; 06-24-2011 at 07:36 AM.

  • #2
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    The way you specify your various parameters in your window.open() doesn't look right to me.

    The w3schools tute on window.open gives details on how the function works.

    Try using alert() or a debugger to see what the values of the input parameters actually are to find the invalid one(s).

  • Users who have thanked bullant for this post:

    kberry (06-24-2011)

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,494 Times in 4,458 Posts
    And the second argument to window.open is *NOT* the title of the window. It is the *NAME* of the window. It's possible that the name is what MSIE is barfing on, though I agree with bullant that the url looks suspicious.

    If you want to set the title, you can do that *after* the window is open:
    Code:
    var w = window.open( url, windowname, options );
    w.title = "whatever makes sense";

  • Users who have thanked Old Pedant for this post:

    kberry (06-24-2011)

  • #4
    Regular Coder
    Join Date
    Mar 2006
    Posts
    728
    Thanks
    35
    Thanked 132 Times in 123 Posts
    Could be the other browsers are ignoring the gibberish, but IE (before #9) will choke on window.outerWidth and window.outerHeight.

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,494 Times in 4,458 Posts
    Ahhh...good catch...didn't even notice those out at the end of the options!

    Teach me to assume.

  • #6
    New Coder
    Join Date
    Jun 2011
    Posts
    80
    Thanks
    13
    Thanked 0 Times in 0 Posts
    Looks like I was treating the 'name' argument as a place to put my <title>.... thanks for the tip!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •