SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Location
    sri lanka
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    logout java script on sitepoint

    hi,
    i like to know the java script that used in logout link of the sitepoint site
    as i know its a java script which works when the user click on the logout link(onclick function)can u explain how the window colour change when the logout link work,do we need to chage the whole page or is it a one line command,enyone explain,i want to use this kind of a thing in my asp pages
    help me

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,264
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    log out script

    View-source shows this (IE only) script:
    HTML Code:
    <script type="text/javascript">
    <!--
    function log_out()
    {
    	ht = document.getElementsByTagName("html");
    	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
    	if (confirm('Are you sure you want to log out?'))
    	{
    		return true;
    	}
    	else
    	{
    		ht[0].style.filter = "";
    		return false;
    	}
    }
    //-->
    </script>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Location
    sri lanka
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this script i got,but it didn't work with my page

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,264
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    page grey out

    And you are using IE and calling the log_out function?

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Location
    sri lanka
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya,i'm using IE and i called the function properly

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,264
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)

    grey out

    Without looking at Sitepoint's code more I can't say why it works as is for Sitepoint. But you're right, I tried it in a page and it didn't work until I changed "html" to "body" in this line
    HTML Code:
    ht = document.getElementsByTagName("body");

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Location
    sri lanka
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,thanks
    now it works fine when change the code to "body" insted of "html"


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
  •