SitePoint Sponsor

User Tag List

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

    <a href="javascript: window_onload()"> ?????

    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="javascript: 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>
    ....

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

    please answer ASAP

    The output to the above is:

    javascript:window_onload();

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

  3. #3
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You might have better luck in the javascript section. I would move you but I don't have any super powers like some of these guys

  4. #4
    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)
    Hi MoOdY,

    Is this page online, so we can get a better look at what you're doing?


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
  •