Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: JS issues

  1. #1
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default JS issues

    Any one know how to Force some one to go to anther page using JS

    i got this but it just hangs.

    Code:
    function logout(  )
    {
    var r=confirm("Are you sure you want to logout?");
    if (r==true)
      {
      document.write('<meta http-equiv="refresh" content="0;URL=logout.php" />');
      }
    else
      {
      }
    }

  2. #2
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    window.location = 'www.microsoft.com';


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  3. #3
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Pretty simple if I remember correctly.

    HTML Code:
    window.location="http://www.pagehere.com";
    
    <!-- which would give you -->
    
    function logout(  ){
    
       var r=confirm("Are you sure you want to logout?");
    
        if (r==true) {
             window.location="logout.php";
        }else{
    
        }
    
    }


    www.fragme.co = a project.

  4. #4
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default

    Okay thats worked to a point but ye it seem to tack me back to the page i was last on :S

    EDIT i am using

    <li><a onclick="logout();" href="#" >Logout</a></li>
    Last edited by VistaBoy; 16-09-2008 at 12:39 PM.

  5. #5
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Try:

    <a onclick="logout();" style="cursor: hand; cursor: pointer;">


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  6. #6
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Uhh, a more logical solution would be this:

    <a onclick="logout(); return false;" href="#">


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  7. #7
    Join Date
    Jul 2007
    Location
    UK
    Posts
    2,470
    Tokens
    2,975

    Latest Awards:

    Default

    I been raedinh up on JS and one solution was use a coundon time when it reaches 1 it redirects to antother page

  8. #8
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Yeah. Jewbear got it... lol at the cursor stuff. But if you don't use return false; some browswers will try and hit it up.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  9. #9
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default

    Quote Originally Posted by Jewish Bear View Post
    Uhh, a more logical solution would be this:

    <a onclick="logout(); return false;" href="#">
    Thank you that got it!

  10. #10
    Join Date
    May 2007
    Posts
    467
    Tokens
    0

    Default

    Okay i got a all new issue

    http://laydesk.com if you go there the links at the bot jobs and contact us you click them they open a box but i can not get them to work in IE6 :S

    code:

    PHP Code:
    function toggleid ) {  
            
        if( 
    document.getElementByIdid ).style.display == 'block' 
        {          
            
    document.getElementById'none' ).className='none';
            
    document.getElementByIdid ).style.display 'none';
        }
        else if( 
    document.getElementByIdid ).style.display == 'none' 
        {  
            
    document.getElementByIdid ).style.display 'block';
            
    document.getElementById'none' ).className='yes';
        }  
            


Page 1 of 2 12 LastLast

Posting Permissions

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