By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,969 Members | 1,735 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,969 IT Pros & Developers. It's quick & easy.

Passing paramiter to new window & use of it

P: n/a
I am trying to open a pop-up window with its own htm code, in order to show
an enlargement of a thumbnail. But I am passing a query string after the? in
the url of the new window. for example:
www.helpme.com?newpic.jpg
I am then trying to put the query string in
<IMG SRC="querystring" WIDTH=400 BORDER=0>.
I don't know how to get the query string to echo "newpic.jpg" in the htm
command in the pop up window.

Thank You.

Paul
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Maybe something like:

<script language="JavaScript">
<!--
document.write('<IMG SRC="' + document.location.search + '" WIDTH=400
BORDER=0>');
// -->
</script>

- Tom Kiefer
thogek @ earthlink . net
"P.L. Owens" <pl*****@uniquedesignsuite.com> wrote in message
news:10*************@corp.supernews.com...
I am trying to open a pop-up window with its own htm code, in order to show an enlargement of a thumbnail. But I am passing a query string after the? in the url of the new window. for example:
www.helpme.com?newpic.jpg
I am then trying to put the query string in
<IMG SRC="querystring" WIDTH=400 BORDER=0>.
I don't know how to get the query string to echo "newpic.jpg" in the htm
command in the pop up window.

Jul 20 '05 #2

P: n/a
Thanks but this still does not seem to be picking up the parameter.

"Tom Kiefer" <th*******@earthlinknot.net> wrote in message
news:MC*******************@newsread2.news.pas.eart hlink.net...
Maybe something like:

<script language="JavaScript">
<!--
document.write('<IMG SRC="' + document.location.search + '" WIDTH=400
BORDER=0>');
// -->
</script>

- Tom Kiefer
thogek @ earthlink . net
"P.L. Owens" <pl*****@uniquedesignsuite.com> wrote in message
news:10*************@corp.supernews.com...
I am trying to open a pop-up window with its own htm code, in order to show
an enlargement of a thumbnail. But I am passing a query string after

the? in
the url of the new window. for example:
www.helpme.com?newpic.jpg
I am then trying to put the query string in
<IMG SRC="querystring" WIDTH=400 BORDER=0>.
I don't know how to get the query string to echo "newpic.jpg" in the htm
command in the pop up window.


Jul 20 '05 #3

P: n/a
P.L. Owens wrote:
I am trying to open a pop-up window with its own htm code, in order to show
an enlargement of a thumbnail. But I am passing a query string after the? in
the url of the new window. for example:
www.helpme.com?newpic.jpg
I am then trying to put the query string in
<IMG SRC="querystring" WIDTH=400 BORDER=0>.
I don't know how to get the query string to echo "newpic.jpg" in the htm
command in the pop up window.


code excerpt:

var re_url = new RegExp('datetime=(\\-?\\d+)');
var datCurrent = (re_url.exec(String(window.location)) ? new Date(new
Number(RegExp.$1)) : new Date());

This takes a date from the url, where it is passed with '?datetime=<date>'

I haven't studied the working of it, but maybe this helps you further.
--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Jul 20 '05 #4

P: n/a
On Sat, 7 Feb 2004 17:11:58 -0800, P.L. Owens <no****@nospam.com> wrote:

[Fixed top-post and snipped]
"Tom Kiefer" <th*******@earthlinknot.net> wrote in message
news:MC*******************@newsread2.news.pas.eart hlink.net...
Maybe something like:

<script language="JavaScript">
Don't use the language attribute - it is deprecated. However, the type
attribute is required and is sufficient.

<script type="text/javascript">
<!--
Don't use SGML comments in SCRIPT sections. The archaic reasons for using
them are no longer valid.
document.write('<IMG SRC="' + document.location.search + '" WIDTH=400
BORDER=0>');
// -->
As above.
</script>

[snip]
Thanks but this still does not seem to be picking up the parameter.


For two reasons:

1) The document object doesn't have a location property, and
2) Even if it did, the resulting URL would have a question mark as its
first character.

Instead, try

document.write('<img src="' + window.location.search.substr(1) + '">');

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.