You are here: Home Development Javascript
Javascript
Javascript: Cookies PDF Print E-mail
User Rating: / 1
PoorBest 
Development - Javascript
Written by Rick   
Friday, 20 March 2009 00:00

Web development, sooner or later, requires dealing with cookies. I've found using Javascript to handle cookies preferable over using php. Reason; "Header already sent" errors.  Generally reading a cookie is not a problem in php and requires less code.

Here's some code I've gathered and modified for my own use for cookie manipulation;

Read more...
 
Javascript: Simple Message Box PDF Print E-mail
User Rating: / 1
PoorBest 
Development - Javascript
Written by Rick   
Thursday, 03 April 2008 10:12

I'm always looking for the easy way to implement code. Here's a real easy way to produce a message box on a web page;

<script type="text/javascript">
alert("your message here")
</script>

Kudos to http://www.xulplanet.com/tutorials/xulqa/q_msgbox.html!
The above site expands on the code to include capturing return information, confirmation dialogues and more.

 
Javascript: Return to Previous Page PDF Print E-mail
Development - Javascript
Written by Rick   
Thursday, 03 April 2008 10:03

Really simple code to return a user to the previous page in a browser.

There are multiple ways of implementing the code;

1) In-line;

<script type="text/javascript">
history.back()
</script>

2) As a link;

<a href="javascript:history.back()">Back</a>

3) As a button; Sorry no demo code for this method. Embedding "javascript:history.back()" in an OnClick event should do the trick. I haven't tried myself, yet.

 

Props to http://www.cryer.co.uk for posting sample code.

Â