How does the following javascript work? After the first script runs the
variables "sGeobytesCity" , "sGeobytesRegio n" and "sGeobytesCount ry"
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=Geob ytesCountry, ..." and on return the document variable
"sGeobytesCount ry" contains a value!!
thanks,
-Steve
------------------------------------------------
<html>
<body>
<script language="Javas cript"
src="http://gd.geobytes.com/Gd?after=-1&variables=Geo bytesCountry,Ge obytesCity,Geob ytesRegion">
</script>
<script language="javas cript">
if(typeof(sGeob ytesCountry) != "undefined" &&
typeof(sGeobyte sRegion) != "undefined" &&
typeof(sGeobyte sCity) != "undefined" )
{
var url = 'CookieDemo.asp x?IPCity=' +
sGeobytesCity + '&IPRegion=' + sGeobytesRegion +
'&IPCountry=' + sGeobytesCountr y ;
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> 3 1845
On 27/05/2005 23:49, Steve Richter wrote: How does the following javascript work? After the first script runs the variables "sGeobytesCity" , "sGeobytesRegio n" and "sGeobytesCount ry" contain values that have been set somehow by the "src=http://gd.geobytes.com ..."
This has nothing to do with Javascript. The Gd resource will be a
server-side script written in PHP, ASP, or whatever, that outputs a
series of var statements. Which variables are written is determined by
the names listed in the query string. Nothing special - just like a
dynamically generated HTML document, only a script instead.
[snip]
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Michael Winter wrote: On 27/05/2005 23:49, Steve Richter wrote:
How does the following javascript work? After the first script runs the variables "sGeobytesCity" , "sGeobytesRegio n" and "sGeobytesCount ry" contain values that have been set somehow by the "src=http://gd.geobytes.com ..."
This has nothing to do with Javascript. The Gd resource will be a server-side script written in PHP, ASP, or whatever, that outputs a series of var statements. Which variables are written is determined by the names listed in the query string. Nothing special - just like a dynamically generated HTML document, only a script instead.
Wow! When do I finally know everything there is to know about web
programming?
thanks for the explanation, Mike. The Src= causes javascript to be
returned from the URL, and that script contains a series of "var =
xxx;" statements. Those vars are then available to other scripts in
the document.
Who invented all this stuff??
-Steve
Steve Richter wrote: Wow! When do I finally know everything there is to know about web programming?
Perhaps never.
[...] Who invented all this stuff??
Tim Berners-Lee started the Web by inventing HTML.
PointedEars This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Brian Glen Palicia |
last post by:
My goal is to accept input from the user into a text box and then
parse the data using split(). The first step is this tiny program to
test the split() function. It runs in IE, but in Mozilla it just
hangs and keeps loading forever. I checked around on the web and in
USENET, but I haven't seen any mention of split() not working in
Mozilla....
|
by: paul |
last post by:
HI! I have being to add the following as part of a function but it just will
not work as is but I don't know why, can someone point out why.
This opens up a popup window for a popup detection and is works in the head
of a page..
<script type="text/JavaScript" language="JavaScript">
var mine =...
|
by: E |
last post by:
I am having trouble with setTimeout working on a second call to the
setTimeout function from a second page which is an html page.
Here is the scenario.
I have a web page and onload it calls a javascript function which calls
setTimeout and will process a second javascript function "Warn" just before
the session expires. The Warn...
|
by: StevePBurgess |
last post by:
A really simple script is driving me up the wall.
I have a very simply facility on a website to allow the user to reorder
items in a database table as she wishes by clicking a link that (in
this case) says "MOVE UP" and links to the script below.
This script snippet that does all the work is shown - the database
connection is established...
|
by: Stan B |
last post by:
I create a popup window by calling window.showModalDialog
Popup window has Ok button with this code attached:
===
string Script = "<script language=JavaScript>" +
"{" +
"window.close();" +
"}" +
"</script>";
| |
by: Peter Michaux |
last post by:
Hi,
I'm thinking about code minimization. I can think of a few places where
whitespace matters
a + ++b
a++ + b
a - --b
a-- -b
when a line ends without a semi-colon in which case the new line
|
by: webEater |
last post by:
I have a problem, it's not browser specific, and I don't get a
solution. I have an (X)HTML document, I show you a part of it:
....
<!--<div class="pad">-->
<div id="eventImages"><img src="" id="eventImage0"
class="eventImage"><img src="" id="eventImage1"
class="eventImage"></div>
|
by: =?Utf-8?B?SmltIFJvZGdlcnM=?= |
last post by:
My question is simple:
How does one debug ASP Classic with Microsoft Visual Web
Developer Express 2005 ("VWD")?
Looming in the back of anyone's mind when you see a posting
like this on any newsgroup is "didn't this guy read the docs?"
Frankly, I "sort of did" a number of times. I feel the days of
"things that are intuitively obvious" to...
|
by: chunk1978 |
last post by:
i wrote a custom PHP script last year and everything worked perfectly... recently my webserver upgraded to PHP 5 and now my script doesn't work properly.
what the script does is: users fill out info and optionally can upload images, the user receives and email receipt of all the data they just submitted, and i'm suppose to receive their...
|
by: Pat |
last post by:
Hi ASP Gurus,
Please help me.
Autocomplete works fine when the control does not have the focus when the
page load.
But when I put the focus on page load, then autocomplete does not work.
I even tried javascript pageload code, but with no success.
<script language ="javascript" type ="text/javascript" >
function focusIt() {
//alert('test');...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |