|
|
Best books about Javasript
|
Javascript get cookie
What
is Cookie? It is explained in this
link. Mouse over the following table to see the cookie
we set.
How
to do get cookies? Copy the following scripts to <head></head> section.
Then
copy the following code to your page. It will pullout the cookie
to the table column when you mouse over the table.
<script language="javascript">
<!--
function getmycookie()
{
document.getElementById('item').childNodes[0].nodeValue =getCookieValue("item");
document.getElementById('price').childNodes[0].nodeValue =getCookieValue("price");
return true;
}
-->
</script>
<table width="300" border="1" onMouseOver="return
getmycookie()">
<tr align="center" bgcolor="#999999">
<td><span class="style3">Item</span></td>
<td><span class="style3">Price</span></td>
</tr>
<tr align="center">
<td><p id="item"> </p></td>
<td><p id="price"> </p></td>
</tr>
</table>
Click
here to see how to set cookie. |
|
|
|