Hi, I'm really no expert. I don't even know if this is called hypercell. But this seems like a simple thing, which I'm sure will be a piece of cake to the gurus out there. I'm using this particular javascript technique whereby when a cell in a table has "onmouseover" the cell changes color, and when the cell has "onmouseout" it goes to a link. A simple sample is as attached. Or basically the whole sample script is like this: <html> <head> <meta http-equiv="Content-Language" content="en-us"> <script type="text/javascript"> function link1(){ window.location.href="http://www.google.com/"; } </script> <script type="text/javascript"> function link2(){ window.location.href="http://www.yahoo.com/"; } </script> </head> <body> <center> <table border="1" width="200" cellspacing="0" cellpadding="0" height="100"> <tr> <td onmouseover="this.style.background='#F1F7FA';this.style.cursor='pointer'" onmouseout="this.style.background='white';" onclick="link1()" width="50%" align="center"> <p align="center">Link to Google</td> <td width="50%" align="center"> </td> </tr> <tr> <td onmouseover="this.style.background='#F1F7FA';this.style.cursor='pointer'" onmouseout="this.style.background='white';" onclick="link2()" width="50%" align="center"> Link to Yahoo!</td> <td width="50%" align="center"> </td> </tr> </table> </center> </body> </html> Code (markup): This script works great. Just that: 1. How do we make the links open in a new window? 2. When we click on the cells, how do we parse the REFERRER info as well as the cookie info? I find that using this script just treats the click as a new click to the link, but I'm sure that some info can be parsed. .
1. use window.open("http://google.com") instead of window.location.href 2. what do u want to do with cookie? To get? no problems: function readCookie(name) { var cookieValue = ""; var search = name + "="; if(document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; } Code (markup): and then do with cookieValue what u want. How to get REFERRER info i dont know
Hey So1, thx alot for your help. Just before I read your post, I actually tried window.open. And the funny thing is, my initial method works, just that I had some settings wrong. How silly of me, searching all over for information and waiting for help. Guess I gotta be really careful next time. Thanks anyway.
About REFERRER... I dont cnow what u use as server-side promgramming language (i use PHP). U can generate JavaScript on server. Just an exmple on PHP: print "<script type='text/javascript'>var referer = " . $_SERVER['HTTP_REFERER'] . "</script>"; If user get this page via clicking link (<a href="our_page">). $_SERVER['HTTP_REFERER'] defined, otherwise u'll get notice message of PHP-interpretator. Use if(isset($_SERVER['HTTP_REFERER'])) condition.