open.window()并传递URL字符串 [英] open.window() and passing URL string

查看:115
本文介绍了open.window()并传递URL字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿那里......我在使用

open.window命令传递url参数时遇到了一些问题。我对java脚本并不十分熟悉,但是

这里是下面的代码。


执行时它会正确打开窗口但不会传递

参数。


(这是coldfusion模板的一部分)


< a href ="# #"

onClick =" window.open(''photopage#.htm?region =#slave .region#'',''prop1'',''location,menubar,height = 600,wid th = 800,滚动条,可调整大小,工具栏=是'');

返回false;">< img src =" #trim(photodir)#/#photoname4# " width =" 90"

height =" 60" HSPACE =" 2英寸VSPACE =" 2英寸border =" 2">< / a>

谢谢,

Wayne

Hey there... I''m having some problems passing url parameters with an
open.window command. I''m not terribly familiar with java script but
here is the code below.

When executed it opens the window properly but does not pass the
parameter.

(this is part of a coldfusion template)

<a href="##"
onClick="window.open(''photopage#.htm?region=#slave .region#'',''prop1'',''location,menubar,height=600,wid th=800,scrollbars,resizable,toolbar=yes'');
return false;"><img src="#trim(photodir)#/#photoname4#" width="90"
height="60" hspace="2" vspace="2" border="2"></a>
Thanks,
Wayne

推荐答案

wayne写道:
嘿那里......我在使用
open.window命令传递url参数时遇到了一些问题。我对java脚本并不十分熟悉,但是这里是下面的代码。

执行时它会正确打开窗口,但不会传递
参数。

(这是coldfusion模板的一部分)

< a href =" ##"
onClick =" window.open(''photopage#。 htm?region =#slave .region#'',''prop1'',''location,菜单栏,身高= 600,wid th = 800,滚动条,可调整大小,工具栏=是'');
返回false ;">< img src =" #trim(photodir)#/#photoname4#" width =" 90"
height =" 60" HSPACE =" 2英寸VSPACE =" 2英寸border =" 2">< / a>
Hey there... I''m having some problems passing url parameters with an
open.window command. I''m not terribly familiar with java script but
here is the code below.

When executed it opens the window properly but does not pass the
parameter.

(this is part of a coldfusion template)

<a href="##"
onClick="window.open(''photopage#.htm?region=#slave .region#'',''prop1'',''location,menubar,height=600,wid th=800,scrollbars,resizable,toolbar=yes'');
return false;"><img src="#trim(photodir)#/#photoname4#" width="90"
height="60" hspace="2" vspace="2" border="2"></a>




所有那些来自coldfusion的哈希'''''?您的链接将在禁用或无法使用JavaScript的浏览器中执行

。将您的URL

放入href属性并使用以下内容打开弹出窗口:

< script type =" text / javascript">

function popWin(u,n,atts){

aWin = window.open(u,n,atts);

}

< / script>

< a href =" photopage#.htm?region =#slave.region#" target =" _blank"

onclick ="

popWin(this.href,''prop1'',''height = 600,width = 800'') ;

返回false;

">< img ...>< / a>

现在链接将会打开在弹出窗口中,用户是否有脚本或

不是。如果脚本可用,则窗口可能具有您建议的

属性。如果脚本不可用,URL将以

标准弹出窗口打开。


-

Rob



Are all those hashes ''#'' from coldfusion? Your link above will do
nothing in a browser with JavaScript disabled or not available. Put
your URL into the href attribute and open the popup using something like:
<script type="text/javascript">
function popWin( u, n, atts ){
aWin = window.open( u, n, atts);
}
</script>

<a href="photopage#.htm?region=#slave.region#" target="_blank"
onclick="
popWin(this.href,''prop1'',''height=600,width=800'');
return false;
"><img ... ></a>
Now the link will open in a pop-up whether the user has scripting or
not. If scripting is available, the window may have your suggested
attributes. If scripting is not available, the URL will open in a
standard pop-up.

--
Rob


wayne写道:
嘿那里......我在使用
open.window命令传递url参数时遇到了一些问题。我对java脚本并不十分熟悉,但这里的代码如下所示。

执行时它会正确打开窗口,但不会传递
参数。


如果浏览器读取:< img src =" #trim(photodir)#/#photoname4#"

和#trim(photodir)#或#photoname4#

是coldFusion条目,你的coldFusion代码有问题......

或你的ColdFusion服务器


您想发送哪个参数?

region =#slave.region# - >

region'的值是#slave.region#或slave.region?

因为#在网址中有意义(锚点)


我会做的,你必须进入浏览器:

photopage.htm?region = slave.region#somewhere

其中:

- photopage.htm是要加载的页面

- region是一个参数

- slave.region是参数值

- 某处是页面上的锚点滚动到


photopage.htm?region = slave.region& city =小镇#某处

- region =''slave.region''

- city = ''小-我的测试,在弹出窗口,位置栏中确切地显示了镇''




photopage.htm?region = slave.region& city = Small-镇#某处


参数很好发送(没有使用coldFusion)

(这是coldfusion模板的一部分)

< ; a href =" ##"
onClick =" window.open(''photopage#.htm?region =#slave .region#'',''prop1'',''location,menubar ,height = 600,wid th = 800,滚动条,可调整大小,工具栏=是'');
返回false;">< img src =" #trim(photodir)#/#photoname4#" ; width =" 90"
height =" 60" HSPACE =" 2英寸VSPACE =" 2英寸border =" 2">< / a>
Hey there... I''m having some problems passing url parameters with an
open.window command. I''m not terribly familiar with java script but
here is the code below.

When executed it opens the window properly but does not pass the
parameter.
if browser reads : <img src="#trim(photodir)#/#photoname4#"
and #trim(photodir)# or #photoname4#
are coldFusion entries, there is a problem with your coldFusion code ...
or your ColdFusion Server

Which parameter(s) do you want to send ?
region=#slave.region# ->
region''s value is #slave.region# or slave.region ?
because # has signification in an url (anchor)

I would have done, and you would have to get in browser :
photopage.htm?region=slave.region#somewhere
where :
- photopage.htm is the page to load
- region is a parameter
- slave.region is the parameter value
- somewhere is an anchor on the page to scroll to

photopage.htm?region=slave.region&city=Small-Town#somewhere
- region = ''slave.region''
- city = ''Small-Town''

in my test, in popup window, location bar displays exactly :
photopage.htm?region=slave.region&city=Small-Town#somewhere

parameters well are send (no coldFusion used)
(this is part of a coldfusion template)

<a href="##"
onClick="window.open(''photopage#.htm?region=#slave .region#'',''prop1'',''location,menubar,height=600,wid th=800,scrollbars,resizable,toolbar=yes'');
return false;"><img src="#trim(photodir)#/#photoname4#" width="90"
height="60" hspace="2" vspace="2" border="2"></a>




不会遗漏:

window.open(' 'photopage#.htm?region =#slave.region#

insteed:

window.open(''#opopopage#.htm?region =#slave.region #

-

Stephane Moriaux et son [moins] vieux Mac



wouldn''t something be missing :
window.open(''photopage#.htm?region=#slave.region#
insteed of :
window.open(''#photopage#.htm?region=#slave.region#
--
Stephane Moriaux et son [moins] vieux Mac


谢谢Rob ...工作得很好!


嘿?有没有办法把一个窗口(用open.window

脚本打开)重新聚焦,如果它被埋在另一个下面它似乎是一个常见的问题。用户打开一个带有

open.window脚本的窗口,然后用户点击桌面上的某个地方就可以了。

窗口在另一个应用程序下消失。从那时起

使用open.window命令对原始链接进行任何后续点击

将内容传递给窗口但是因为它埋没了用户

不知道。


谢谢,

Wayne

Thanks Rob... worked great!

Hey? is there a way to bring a window (opened with an open.window
script) back in to focus should it get buried under another window. It
seems to be a common problem. A user opens a window with the
open.window script then the user clicks somewhere on their desktop and
the window disappears under another application. From that point on
any subsquent clicks on the original link with the open.window command
delivers the content to the window but since it''s buried the user
doesn''t know.

Thanks,
Wayne


这篇关于open.window()并传递URL字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆