<html>
<head>
<script>
window.onload = function(){
if ( window.opera ) {
alert("You're using Opera, pick me!");
}
};
</script>
</head>
<body>
<h1>Which browser?</h1>
<a href="http://mozilla.com/" id="firefox"> Firefox</a><br/>
<a href="http://apple.com/" id="safari"> Safari</a><br/>
<a href="http://opera.com/" id="opera"> Opera</a><br/>
<a href="http://microsoft.com/" id="ie"> Internet Explorer</a>
</body>
</html>
function isSet (varName){ //check if the the object link exist
var bAry=varName.split(/\./),
d=window;
for(var i=0,j=bAry.length;i<j;i++){
if (d[bAry[i]] == undefined) {
return false;
}
d = d[bAry[i]];
}
return true;
} function setNewvalue(varName,newValue){ //set value to a member, and create the object link
var bAry=varName.split(/\./);
var d=window;
for(var i=0,j=bAry.length-1;i<j;i++){
d[bAry[i]] = d[bAry[i]] || {};
d=d[bAry[i]]
}
d[bAry[bAry.length-1]]=newValue
}