Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7762845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:30:48+00:00 2026-06-01T14:30:48+00:00

I want to run a javascript one time. I tried using a script from

  • 0

I want to run a javascript one time.
I tried using a script from Dynamic Drive, but it seems to not work with scripts.

I want it to run the first time the user visits the page, but then doesn’t pop up again.

Any help?

My script is

    <script src="http://www.google.com/jsapi"></script><script>google.load("jquery", "1");</script> 
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script type="text/javascript">
    Username="___", <!-- Facebook Username Without http://facebook.com/ -->
    Title="Join Our Facebook!", <!-- Title -->
    Skin="01", <!-- 01 Through 04 -->
    Time="15", <!-- Countdown In Seconds -->
    Wait="0", <!-- Wait For Popup -->
    Lang="en"
</script>
<script type="text/javascript" src="likeboxfbfanpro.js"></script>
<script type="text/javascript">$(document).ready(function(){$().popupbox({ closeable: false });});</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:30:50+00:00Added an answer on June 1, 2026 at 2:30 pm

    You can do two things:

    • Set a cookie after the first time you show the message and test for the existence of the cookie on each page load. Show the message if the cookie does not exist or skip it if it does.

    • Set a server side session value (session only), or a database record (spans sessions if you can somehow identify the returning visitor (i.e. IP)) to control the HTML after the first page is served to the client. Only send the message html if there is no session/database value yet

    If you want to set cookies. Here’s a small script that does the cookie handling:

    function createCookie(name,value,days) {
    if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }
    
    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }
    
    function eraseCookie(name) {
        createCookie(name,"",-1);
    }
    

    Now in your code you can use this as follows:

    if (!readCookie('alreadyShown')) {
      .. add you show message code here...
      createCookie('alreadyShown', true)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run Protovis javascript from Java and get the evaluated SVG code.
I want to run a script remotely. But the system doesn't recognize the path.
I want to run a simple JavaScript function on a click without any redirection.
Is it possible to run Javascript inside an Ember View Handlebars template? I want
I want run a script as follows: runner: ssh 'java program &' ssh 'java
Why this code don't work,when i want run this code vwd 2008 express show
I am using PHP conditions and want to know if I can run a
I want to pass 2 javascript events in one click, I put 2 of
Fairly basic question i'm hoping. In the following javascript, I want to run the
I'm using Javascript to create a textarea that I want to be a ckeditor.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.