Recommended Posts

Posted

I have tried

<var visit

visit+=1

if not visit = 13>

<script type="text/vbscript">

MsgBox "I enjoy lemon juice."</script>

<script type="text/vbscript">

MsgBox "I enjoy Motley Crue music"</script>

<script type="text/vbscript">

MsgBox "Tornadoes can climb mountains"</script>

<script type="text/vbscript">

MsgBox "Spiders are arachnids and not insects"</script>

<script type="text/vbscript">

MsgBox "Meow"</script>

<script type="text/vbscript">

MsgBox "Tornadoes can cross water (Aqua)"</script>

<script type="text/vbscript">

MsgBox "I love Diet Root Beer"</script>

<script type="text/vbscript">

MsgBox "I love Oreos"</script>

<script type="text/vbscript">

MsgBox "Tornadoes can climb hills"</script>

<script type="text/vbscript">

MsgBox "ROCKY V is the best movie ever!!!!!!!"</script>

<script type="text/vbscript">

MsgBox "I love cats!!!!"</script>

No luck though

Posted (edited)

Haven't touched web design since 2007, so I'm a little out of touch (okay, a lot actually) but I don't think it's possible for you to achieve what you want to do via HTML alone. HTML is merely a markup language, that means it's only purpose it to set the layout of the webpage. It's not a programming language or scripting language. You'll most likely need a server side scripting language like PHP to do what you want (your server needs to have it installed). You could also do it with cookies (pam not included) if you wanted to avoid server side languages, though this might take a lot more code to get it working properly.

You have used javascript as well, though if I remember correctly, variables in javascript get wiped after a page reload, as javascript is a local scripting language only.

Edited by Mahone
Posted

I hope I'm not the only forum member that has read the first three posts and felt something akin to what I'm sure Joseph Smith felt when he first saw what it was God wanted him to translate into english....

Posted

RipplecutBuddha, you aren't the only one. What is sad, I used to know html programming - made a website in 1998/1999 that is now gone, and I took C++ programming class twice in college... and those first posts still looked greek to me.

Posted (edited)

Posted Image

This is Greek..That looks alien.

Edited by pam
Posted (edited)

This is Greek..That looks alien.

The best thing about computer languages as opposed to spoken languages, is that they can only mean one thing. You can only interpret it in one way. No taking into account tone of voice or body language. Makes life so much easier, especially for us autistic people. Does anyone wonder why autism and computers go so well together? :P

Edited by Mahone
Posted (edited)

I would recommend JQuery, a superset of JavaScript, but only if you start doing more advanced scripts.

But for your particular solution, you will need to store the visit count in a cookie, since variables go away after the page loads unless you store them somehow (cookies is one technique).

JavaScript Cookies

The link above has some function definitions for setting and getting cookie values.

With those functions included in your script, you can then use them to do what you want:

<script type="text/javascript">

function setCookie(c_name,value,exdays)

{

....

}

function getCookie(c_name)

{

...

}

var visits=getCookie("visits");

if (visits=null) visits = 1; // initialize the visits to 1 if it isn't set

setCookie("visits", visits+1, 5); // set the cookie value to visits + 1 and store that value for 5 days

if (visits < 5) alert('message here'); // popup a message if the visits is less than 5

</script>

Now, I hope I am not doing your homework for you.

Edited by bytebear

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...