Simple Machines Community Forum

General Community => Scripting Help => Topic started by: diplomat. on May 26, 2005, 10:25:08 PM

Title: Setting cookie
Post by: diplomat. on May 26, 2005, 10:25:08 PM
I found a javascript that will collapse table rows. this is the code:


<script type="text/javascript">

function showhide(){

if(document.all.row1.style.display == 'none'){
document.all.row1.style.display ='';
}
else{
document.all.row1.style.display ='none';
}

return false;

}

</script>


http://www.titaniumwg.com/test.php

im testing it on my test page and it works, but it doesnt set a cookie obviously. i have no clue how to edit it to cookie when someone collapse a row, it stays collapsed and when its expanded. how could it do this?
Title: Re: Setting cookie
Post by: [Unknown] on May 26, 2005, 10:32:12 PM
Using the Simple Machines site theme here, go to the board index and view its source.  Search for "document.cookie".  There's a few instances.

-[Unknown]
Title: Re: Setting cookie
Post by: Saleh on May 28, 2005, 03:36:33 AM
one good read about cookies in javascript:
http://www.netspade.com/articles/javascript/cookies.xml