S
Steve Richter
How does the following javascript work? After the first script runs the
variables "sGeobytesCity", "sGeobytesRegion" and "sGeobytesCountry"
contain values that have been set somehow by the
"src=http://gd.geobytes.com..."
how does it do that? It appears to pass the string
"variables=GeobytesCountry, ..." and on return the document variable
"sGeobytesCountry" contains a value!!
thanks,
-Steve
------------------------------------------------
<html>
<body>
<script language="Javascript"
src="http://gd.geobytes.com/Gd?after=-1&variables=GeobytesCountry,GeobytesCity,GeobytesRegion">
</script>
<script language="javascript">
if(typeof(sGeobytesCountry) != "undefined" &&
typeof(sGeobytesRegion) != "undefined" &&
typeof(sGeobytesCity) != "undefined")
{
var url = 'CookieDemo.aspx?IPCity=' +
sGeobytesCity + '&IPRegion=' + sGeobytesRegion +
'&IPCountry=' + sGeobytesCountry ;
document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL="+url+"'>");
}
else
{
document.write( "<META HTTP-EQUIV='Refresh' CONTENT='0;
URL=CookieDemo.aspx'>" ) ;
}
</script>
</body>
</html>
variables "sGeobytesCity", "sGeobytesRegion" and "sGeobytesCountry"
contain values that have been set somehow by the
"src=http://gd.geobytes.com..."
how does it do that? It appears to pass the string
"variables=GeobytesCountry, ..." and on return the document variable
"sGeobytesCountry" contains a value!!
thanks,
-Steve
------------------------------------------------
<html>
<body>
<script language="Javascript"
src="http://gd.geobytes.com/Gd?after=-1&variables=GeobytesCountry,GeobytesCity,GeobytesRegion">
</script>
<script language="javascript">
if(typeof(sGeobytesCountry) != "undefined" &&
typeof(sGeobytesRegion) != "undefined" &&
typeof(sGeobytesCity) != "undefined")
{
var url = 'CookieDemo.aspx?IPCity=' +
sGeobytesCity + '&IPRegion=' + sGeobytesRegion +
'&IPCountry=' + sGeobytesCountry ;
document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL="+url+"'>");
}
else
{
document.write( "<META HTTP-EQUIV='Refresh' CONTENT='0;
URL=CookieDemo.aspx'>" ) ;
}
</script>
</body>
</html>