Question : session storage dynamic key

I am writing a framework to test sessionStorage behavior
there are two ways I have found to set a key
sessionStorage["mykey"] = "bla";
sessionStorage.myKey = "bla"
sessionStorage.setItem("myKey", "bla");


How can i replace myKey with a variable and use the dot notation as I need to write a function to test this feature

sessionStorage.myKeyVar = "bla"
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function setSession(inKey, inVal)
{
//this doesn't work but this is what i need tot test the dot setter
	eval(sessionStorage.inKey) = inVal;
	
	if(sessionStorage.getItem(inKey) == inVal)
	{
		alert("success");
	}
}

Answer : session storage dynamic key

Hi kravindra,

How about using IFRAMES here?

Regards,
Chinmay

Random Solutions  
 
programming4us programming4us