Results 1 to 1 of 1

Thread: Toggle b/w two Hyperlinks using javascript:

  1. #1
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Toggle b/w two Hyperlinks using javascript:

    Below are my script to toggle b/w two different links,

    Code:
    <html lang="en-US">
    <head>
    <title>toggle b/w 2 different links</title>
    <script type="text/javascript"><!--
    display=1;
    function displayvalue()
    {
    document.getElementById("sv1").style.display = "block";
    document.getElementById("dw1").style.display = "none";
    }
    function ShowHide()
    {
    if (display==1) {
    document.getElementById("sv1").style.display = "none";
    document.getElementById("dw1").style.display = "block";
    //document.getElementById('javaFun')  calling java func from javascript
    display=2;
    }
    else {
    document.getElementById("sv1").style.display = "block";
    document.getElementById("dw1").style.display = "none";
    //document.getElementById('javaFun1')  calling java func from javascript
    display=1;
    }
    }
    function Func1Delay()
    {
    document.getElementById("sv1").style.display = "none";
    document.getElementById("loadimage").innerHTML="<input type='image' src='Loading.gif'>";
    setTimeout("LoadImage()", 300);
    }
    
    
    function LoadImage()
    {
    document.getElementById("loadimage").innerHTML="";
    ShowHide();
    }
    
    
    --></script>
    </head>
    <body background="GsNJNwuI-UM.gif"onload="displayvalue()">
    
    <div id="sv1" >
    <a onclick ="Func1Delay()" href="javascript:;">click me</a>
    </div>
    <div id="loadimage"></div>
    <div id="dw1" >
    <a onclick ="ShowHide()" href="javascript:;">Download me</a>
    </div>
    </body>
    </html>
    whenever we call a java method , (consider this line:- document.getElementById('javaFun');)after the completion of java call the page is reloading, how control this reloading after the server completing the request....?
    Last edited by jscheuer1; 05-03-2012 at 08:13 AM. Reason: Format

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
  •