SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <a href="java_script_: window_onload()"> please help ASAP! :)

    I have a problem, when the image is clicked, the link3 value (which is correct) is displayed on the screen instead of it going to that page!! Can someone tell me what the problem is?


    Code:
    <%@ LANGUAGE="JavaSCRIPT" %>
    in head:
    Code:
    <%
    	var link3;
    	var jack;
    	var position;
    %>
    
    <script language="JavaScript" type="text/javascript" src="/clf02/scripts/browser.js"></script>
    
    <script language="JavaScript">
    link3 = window_onload();
    	 
    function window_onload()
    {
    	var link2;
    	link2 = parent.location.href;
    	alert("The address of the parent frame is " + link2);
    	position = link2.lastIndexOf("-");
    	link3 = link2.substring(0, position) + "e.html";
    	return link3;
    }
    </script>

    in body:
    Code:
    <body language=JavaScript bgcolor="#FFFFFF">
    ....
    <a href="java_script_: window_onload()"><span lang="fr"> <img src="../images/nav1st_level_lang-e.gif" width="89" height="14" vspace="0" hspace="0" border="0" alt="Fran&ccedil;ais"></span></a>
    ....

    The output to the above is:

    java_script_:window_onload();

    which is displayed on the browser instead of the return value (href) of the function.

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This thread is an accidental duplicate of this thread


Bookmarks

Posting Permissions

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