...

View Full Version : What does this mean in a Javascript?



newbie25
06-06-2004, 07:46 PM
Someone wrote some code for me that contains the following statement, and I'd like to know what it means. The statement (contained in the HEAD section, sandwiched between <script> and </script>, is:

function yourfunctn(s) {
window.open("?xz="+s,"data","resizeable=yes[etc etc--other variables for the window to be popped-up]");
}

This statement is contained within some HTML code that is written to a window. xz is the name of a variable that the PHP script contains. xz clearly is the name of a file that's written in the window.

What I want to know is, what is the meaning of the ?, the =, and the +s in the statement above.

Tnx in advance.

Willy Duitt
06-06-2004, 08:28 PM
Look at the url to this thread:

http&#58;//www.codingforums.com/showthread.php?t=39864

Garadon
06-06-2004, 09:31 PM
a ? mark is used to seperate the url on the rigth side of it from the data on the left. basicly the idea is to pass data from page a to page be by writing in the link on page a: b?name=value.
then on page be you would have access to a variabel called name with the value as its value in a server side language, and in javascript using a user made script.

fredmv
06-06-2004, 09:35 PM
What Gardon said is pretty much correct. This is referred to as a query string (http://www.webopedia.com/TERM/q/query_string.html).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum