English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

My current script is:





I need to be able to add it to my site so it only appears once on the visit if go back to the page.

Thank you.

2007-10-30 06:14:57 · 4 answers · asked by will o 1 in Computers & Internet Programming & Design

4 answers

You need to set a cookie - that's the only way to persist information between different visits.

Here's some sample scripts explaining how to set and get cookies:
http://www.quirksmode.org/js/cookies.html

Using those scripts in the header of your page, you would probably do something like:

var x = readCookie('dare_cookie')
if (!x) {
var x=prompt("Who dares to enter my domain? ","");
document.writeln(x+", Welcome to my site. Mwuah ha ha!")
createCookie('dare_cookie','visited',365)
}

By the way, the element is not supported by many browsers, and it's strongly recommended not to use it.

2007-10-30 23:56:21 · answer #1 · answered by Daniel R 6 · 0 0

I guess you would have to set a page counter and pass that value to a cookie e.g. var pageviewed=0 and then when the page is visited pageviewed is set to 1.

Each subsequent time the page is viewed the cookie value has to be read to determine whether the message is displayed or not.

It means you will need to incorporate a few more lines of code to accomplish this.

2007-10-30 06:24:03 · answer #2 · answered by ray_diator 7 · 0 0

hiya, Are you using a proxy or something else comparable? that occurs generally while using a proxy. If no longer, attempt this: Open cyber web Explorer (assuming that's what you're using) click on kit > cyber web techniques. click on the more desirable tab > Reset this could undo any settings made considering IE became into put in, yet you may could desire to enable Java and Flash lower back. desire that helps :-)

2016-10-14 08:57:21 · answer #3 · answered by ? 4 · 0 0

This kind of stuff is a breeze using php,
I would also use a cookie, it would store a value that indicates whether they've seen the marquee or not.

hth

2007-10-30 06:41:48 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers