|
DemoTested With: IE6, FF, and Opera (If anyone can try IE7 I'd be greatful.  ) Alright, I wanted to do something unique and non-PB, so this is what I came up with. I made an artificial cacheing system that uses window.name and AJAX to do it. I've shown this to 3-4 people so far. Peter pointed out only one thing of concern, and that's how much data can be stored in window.name before the computer starts to lag. =/ I'm thinking of a way to work this out, but it hasn't been done yet so it doesn't matter really. Other then that, I don't know of anything that could pose a real problem with this.  So enjoy the open source snippet. Oh yeah, I forgot to say what its purpose is. Its purpose is to store data between page loads sort of like the cache system, so its an Artificial Cache as I said.
|
|
|
|
|
<script> window.name = "data.js%m%6%m%3%w%h%a%t%e%v%e%r"; var data2 = "=D"; function erase(){ window.name = ""; } function shout(){ alert(window.name); } function shoutIt(){ alert(data2); } </script> <a href="javascript: shout();">Show Window Name</a><br><br> <a href="javascript: erase();">Clear Window Name</a><br><br> <a href="javascript: shoutIt();">Alert "data2"</a> I win  . j/k Nice job Chris. I'm gonna take a look at the source later.
Last Edit: Jun 19, 2006 3:12:28 GMT by Nate
|
|
|
|
Just uses window.name  Unfortunately, it only works until you close the tab (in FF) or the window. I open most of my links in new tabs so if it was used for something else, it wouldn't work for me XD. Nice job though... I think ;P
|
|
|
|
Yeah. That's a problem that Wonder actually gave me a solution to.... I've been thinking about integrating it into this code, but havn't really had time. Also, the reason that happens is, the name is different for the new window.
|
|
|
|
|
Therefore, "window"  I wonder if there's a document.name....
|
|
|
|
You could create the attribute, but it only refers to the current page. navigator.name might work. o.o
|
|
|
|
|
Interesting, I'm gonna try it  EDIT: Works like window name, only it comes up with that horrible undefined message instead of a blank.
Last Edit: Jul 23, 2006 5:08:02 GMT by hpmad
|
|
|