SitePoint Sponsor

User Tag List

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

    Displaying content one first view only

    I have content inside a DIV that I want to display only the first time the page is viewed. I'm assuming this can be done with a cookie and javascript with little difficulty.

    So basically it needs to write the cookie and the code for the DIV on the first load and then anytime that person returns to the page, the source for the div is omitted.

    I've been researching this for a while but just am not getting anywhere. Any ideas?
    Joe Bartlett

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't use JavaScript to remove the source code for an element. You have to use a server-side language, like PHP, for that.

    JavaScript could be used to hide the element when the page loads, however.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •