Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Demo

Tested 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. :P

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. ;)


Nate

Nate Avatar

**
Official Member

85


July 2007
<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 :P. 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

hpmad

hpmad Avatar



858


September 2005
Just uses window.name :P 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

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
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. :P

hpmad

hpmad Avatar



858


September 2005
Therefore, "window" :P

I wonder if there's a document.name....

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
You could create the attribute, but it only refers to the current page. navigator.name might work. o.o

hpmad

hpmad Avatar



858


September 2005
Interesting, I'm gonna try it :D

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

newBookmarkLockedFalling