Print Page | Close Window

Simple javascript

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=4688
Printed Date: 29 March 2026 at 11:56pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Simple javascript
Posted By: Mart
Subject: Simple javascript
Date Posted: 02 August 2003 at 1:23pm

Hello, i need some helpl writing a simple javascript i want it to display an alert this is what i have got so far:

<script language="javascript">
alert("You have new private messages!");
</script>

It works fine but i want it to only alert once eg. by setting a cookie but i have no idea how to set cookies in javascript.

Thanks, Mart.




Replies:
Posted By: KCWebMonkey
Date Posted: 03 August 2003 at 3:21pm

This article has 5 or 6 pages on creating and reading cookies with javascript.

http://hotwired.lycos.com/webmonkey/98/29/index1a_page7.html?tw=programming - http://hotwired.lycos.com/webmonkey/98/29/index1a_page7.html?tw=programming



Posted By: PaulGQ
Date Posted: 03 August 2003 at 4:00pm
instead of a cookie, I would just attach it to a dingy or pic that displays "new message".  use the onload function to trigger the function the one time a new messgae indicated.


Posted By: Mart
Date Posted: 04 August 2003 at 10:19am
Thanks for that KCWebMonkey it works perfect now...


Posted By: KCWebMonkey
Date Posted: 04 August 2003 at 11:11am
no problem.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net