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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    JavaScript Code works in Firefox but not IE 7

    I have created a very simple JavaScript code to display larger images of a thumbnail image on the main section of a website. It works fine in FF3 however in IE 7 is giving me an error code of Invalid argument on line 6 character 1. The funny thing is I have used this exact code in another site and it worked fine with IE 7. I have tried fixing this problem for the last few days with no solutions.

    Here is a copy of my code.

    <!--
    function picbox(aston)
    {
    window.open(aston+".html",aston,"height=630,width=765,toolbar=no");
    }
    // -->


    And the code in the body section.

    <A href="#" onclick="picbox('pages/gallery/aston')"><img src="images/Rides/Aston Martin2.jpg" alt="Aston Martin"/></a><br/>


    I'm sure its something simple I'm missing since I'm new to JavaScript.

  • #2
    Banned
    Join Date
    Nov 2008
    Location
    not found
    Posts
    284
    Thanks
    0
    Thanked 53 Times in 51 Posts
    Unacceptable characters in the window name. This should filter them:
    Code:
    function picbox(aston)
    {
    window.open(aston+".html",aston.replace(/\W/g, '_'),"height=630,width=765,toolbar=no");
    }

  • Users who have thanked randomuser773 for this post:

    Stewblack23 (07-04-2009)

  • #3
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thanks For Your Help.

    Thanks for the help. That script that you gave me works perfectly.


  •  

    Posting Permissions

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