dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: IE6 and javascript problem.

  1. #1
    Join Date
    Sep 2006
    Posts
    12

    IE6 and javascript problem.

    First of all please excuse my newbie code.. i don't expect this to be a big part of the site so i didn't code it the g o o d way because i really don't have knowledge on javascript..

    My problem:

    http://rize101.info/tolovero-friends...out/#more-3338

    whenever trying to click on the "click here to get code" and "preview layout"
    the javascript doesn't work in ie6, but works fine on firefox.

    the <head></head>code:
    Code:
    <script language='javascript'>
    function move(choice){
    if(choice==1)
    page='http://wikimyprofile.com/linker.php'
    else
    page='http://friendsterko.com/extras/convert/friendster-xover.php'
    document.getElementById('formName').action=page
    document.getElementById('formName').submit()}
    </script>
    the code within the body tags:
    Code:
    <center><img src="http://img403.imageshack.us/img403/6830/tolovero06162290617969nw5.jpg" border="0" width="300" height="150">
    </center><br>
    <!--more-->
         <form name="formName" id="formName" method="post">
    
    <input type="button" name="backBut" id="backBut" value="CLICK HERE TO GET CODE" onclick="javascript:move('1');">
    <input type="button" name="confirmBut" id="confirmBut" value="Preview Layout" onclick="javascript:move('2');">
      <textarea type="text" name="code" class="hide" rows="1" cols="1">http://boxstr.com/files/3561649_whehe/tolovero1.swf</textarea>
    </form>

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,943

    Re: IE6 and javascript problem.

    So, turn on IE's ability to display a script error and debug your code. It's under the last tab inside of the Internet Options.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Sep 2006
    Posts
    12

    Re: IE6 and javascript problem.

    the error is: object doesn't support this property or code.. any help on debugging this?

  4. #4
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,943

    Re: IE6 and javascript problem.

    It also gives you a line number. Find out on what line the error occurs. Then, you can analyze that code.

    EDIT: I think I know your problem...You are passing a string as the parameter. Then, you check it as though it is a number. Use the following instead.

    Code:
    <input type="button" name="backBut" id="backBut" value="CLICK HERE TO GET CODE" onclick="move(1)">
    <input type="button" name="confirmBut" id="confirmBut" value="Preview Layout" onclick="move(2)">
    And you don't need the javascript: since the onclick even will already register as JavaScript in your page's scenario.
    Last edited by PeejAvery; December 14th, 2008 at 09:56 PM.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Sep 2006
    Posts
    12

    Re: IE6 and javascript problem.

    i fixed it. the "page" conflicts with my css id page.. i had to make it
    Code:
    <script language='javascript'>
    function move(choice){
    if(choice==1)
    page1='http://wikimyprofile.com/linker.php'
    else
    page1='http://friendsterko.com/extras/convert/friendster-xover.php'
    document.getElementById('formName').action=page1
    document.getElementById('formName').submit()}
    </script>
    to avoid conflict

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)