在javascript中有一个ASP变量 [英] having an ASP variable in javascript

查看:50
本文介绍了在javascript中有一个ASP变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个菜单,我在我的Intranet应用程序上使用,虽然我最近尝试更换它的b $ b,但我最终回到了它。它完全用

javascript构建,效果很好。


但是,有些网页我希望能够放一个

项目成为链接的查询字符串。也就是说,我可能有一个链接是

措辞添加到此票证并且与该文本相关联的超链接是

的行addtoticket.asp?ticketid = 1000


我无法弄清楚如何将ASP变量放入由

javascript构建的链接中。这是主要问题。我如何在一个

javascript中拥有ASP变量?


因为它是Inranet,所以我没有给你看的页面。但是,我已将两个javascript文件压缩起来并将它们放在
www.middletree.net/js.zip


此外,在这种情况下,特定于IE的代码不会成为问题。 100%的用户

在IE5 +

I have a menu that I use on my Intranet app, and while I did try to replace
it recently, I ended up going back to it. It''s built entirely with
javascript, and works great.

However, there are certain pages where I would like to be able to put an
item into a querystring for a link. That is, I might have a link which is
worded "Add to this ticket" and the hyperlink associated with that text is
along the lines of "addtoticket.asp?ticketid=1000"

I am not able to figure out how to have an ASP variable into a link built by
javascript. This is the main question. How can I have the ASP variable in a
javascript?

Because it''s Inranet, I don''t have the page to show you. However, I have
zipped up the two javascript files and placed them at
www.middletree.net/js.zip

Also, in this case, IE-specific code will not be a problem. 100% of users
are on IE5+

推荐答案

替换

addtoticket.asp?ticketid = 1000

with

addtoticket.asp?ticketid =<%= YourAspVariable%>


-

Curt Christianson

所有者/首席开发人员,DF-Software
www.Darkfalz.com

" middletree" < MI ******** @ htomail.com>在消息中写道

新闻:OZ ************** @ tk2msftngp13.phx.gbl ...
replace
addtoticket.asp?ticketid=1000
with
addtoticket.asp?ticketid=<%=YourAspVariable%>

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"middletree" <mi********@htomail.com> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
我有一个菜单我在我的Intranet应用程序上使用,虽然我最近尝试用
替换它,但我最终还是回到了它。它完全用
javascript构建,效果很好。

然而,有些页面我希望能够将
项放入查询字符串中一条链接。也就是说,我可能有一个
措辞添加到此票证的链接。与该文本相关联的超链接是addtoticket.asp?ticketid = 1000

我无法弄清楚如何将ASP变量放入链接通过javascript构建
。这是主要问题。我怎样才能在
中使用ASP变量javascript?

因为它是Inranet,所以我没有给你看的页面。但是,我已经将两个javascript文件压缩并将它们放在
www.middletree.net/js.zip

此外,在这种情况下,IE特定的代码不会成为问题。 100%的用户使用IE5 +
I have a menu that I use on my Intranet app, and while I did try to replace it recently, I ended up going back to it. It''s built entirely with
javascript, and works great.

However, there are certain pages where I would like to be able to put an
item into a querystring for a link. That is, I might have a link which is
worded "Add to this ticket" and the hyperlink associated with that text is
along the lines of "addtoticket.asp?ticketid=1000"

I am not able to figure out how to have an ASP variable into a link built by javascript. This is the main question. How can I have the ASP variable in a javascript?

Because it''s Inranet, I don''t have the page to show you. However, I have
zipped up the two javascript files and placed them at
www.middletree.net/js.zip

Also, in this case, IE-specific code will not be a problem. 100% of users
are on IE5+



<%

''这是asp所以它在服务器上运行


Dim aVar

aVar =" 1000"

%>

< script language =" Javascript">

//这在客户端上运行,除了<%= aVar%>在服务器上投入

的部分

函数AddToTicket()

{

window.open(' 'theUrl.asp?id =<%= aVar%>'');

}

< / script>

" ; middletree" < MI ******** @ htomail.com>在消息中写道

新闻:OZ ************** @ tk2msftngp13.phx.gbl ...
<%
''This is asp so it runs on the server

Dim aVar
aVar="1000"
%>
<script language="Javascript">
//this runs on the client, except for the <%=aVar%> part which gets
tossed in on the server
function AddToTicket()
{
window.open(''theUrl.asp?id=<%=aVar%>'');
}
</script>
"middletree" <mi********@htomail.com> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
我有一个菜单我在我的Intranet应用程序上使用,虽然我最近尝试用
替换它,但我最终还是回到了它。它完全用
javascript构建,效果很好。

然而,有些页面我希望能够将
项放入查询字符串中一条链接。也就是说,我可能有一个
措辞添加到此票证的链接。与该文本相关联的超链接是addtoticket.asp?ticketid = 1000

我无法弄清楚如何将ASP变量放入链接通过javascript构建
。这是主要问题。我怎样才能在
中使用ASP变量javascript?

因为它是Inranet,所以我没有给你看的页面。但是,我已经将两个javascript文件压缩并将它们放在
www.middletree.net/js.zip

此外,在这种情况下,IE特定的代码不会成为问题。 100%的用户使用IE5 +
I have a menu that I use on my Intranet app, and while I did try to replace it recently, I ended up going back to it. It''s built entirely with
javascript, and works great.

However, there are certain pages where I would like to be able to put an
item into a querystring for a link. That is, I might have a link which is
worded "Add to this ticket" and the hyperlink associated with that text is
along the lines of "addtoticket.asp?ticketid=1000"

I am not able to figure out how to have an ASP variable into a link built by javascript. This is the main question. How can I have the ASP variable in a javascript?

Because it''s Inranet, I don''t have the page to show you. However, I have
zipped up the two javascript files and placed them at
www.middletree.net/js.zip

Also, in this case, IE-specific code will not be a problem. 100% of users
are on IE5+



好的,我会试一试。但那是显而易见的,我认为它不会起作用。

Curt_C [MVP]" < software_AT_darkfalz.com>在消息中写道

news:uM ************** @ tk2msftngp13.phx.gbl ...
OK, I''ll try it. But that was so obvious that I didn''t think it would work.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uM**************@tk2msftngp13.phx.gbl...
替换
addtoticket.asp?ticketid = 1000
addtoticket.asp?ticketid =<%= YourAspVariable%>

-
Curt Christianson
所有者/首席开发人员,DF-Software
www.Darkfalz.com
" middletree" < MI ******** @ htomail.com>在消息中写道
新闻:OZ ************** @ tk2msftngp13.phx.gbl ...
replace
addtoticket.asp?ticketid=1000
with
addtoticket.asp?ticketid=<%=YourAspVariable%>

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"middletree" <mi********@htomail.com> wrote in message
news:OZ**************@tk2msftngp13.phx.gbl...
我有一个我用的菜单内联网应用程序,虽然我最近尝试替换
I have a menu that I use on my Intranet app, and while I did try to replace
,但我最终还是回到了它。它完全用
javascript构建,效果很好。

然而,有些页面我希望能够将
项放入查询字符串中一条链接。也就是说,我可能有一个链接,其中
措辞添加到此票证与该文本相关联的超链接
的行是addtoticket.asp?ticketid = 1000

我无法弄清楚如何将ASP变量放入链接
it recently, I ended up going back to it. It''s built entirely with
javascript, and works great.

However, there are certain pages where I would like to be able to put an
item into a querystring for a link. That is, I might have a link which is worded "Add to this ticket" and the hyperlink associated with that text is along the lines of "addtoticket.asp?ticketid=1000"

I am not able to figure out how to have an ASP variable into a link built by
javascript构建。这是主要问题。如何在
javascript. This is the main question. How can I have the ASP variable
javascript中获得ASP变量

in a




因为它是Inranet,我没有页面给你看。但是,我已经将两个javascript文件压缩并将它们放在
www.middletree.net/js.zip

此外,在这种情况下,IE特定的代码不会成为问题。 100%的

javascript?

Because it''s Inranet, I don''t have the page to show you. However, I have
zipped up the two javascript files and placed them at
www.middletree.net/js.zip

Also, in this case, IE-specific code will not be a problem. 100% of



用户在IE5上


users are on IE5+




这篇关于在javascript中有一个ASP变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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