我可以将javascript值传递给.asp吗? [英] Can I pass a javascript value to .asp?

查看:57
本文介绍了我可以将javascript值传递给.asp吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我希望我能为此做好准备...


我制作了一个允许用户使用的.asp页面通过照片目录切换。

页面完成以下操作:

根据下拉菜单选择照片目录

使用fso获取目录中的照片数量

循环播放照片w前进和后退按钮发送图片

#带+1或-1值

检索'&显示来自基于数据库的rs'的照片描述字段

在其图片上#


尴尬的是页面刷新自己请求。

有没有办法留在.asp而不刷新?





我找到了一些很好的JavaScript,将通过图片循环使用

forward&向后按钮,但我似乎无法让javascript将下一张或上一张图片的

值发送回.asp函数,该函数检索

描述字段来自db。我绝对不想为每个目录硬编码

!请原谅我,但我一点都不...

精通js ...


有没有人曾经这样做过,如果有的话,我怎么能检索那个值?

我做的一切似乎都没有用。 javascript在初始加载时获取了

..asp代码的值,但在那之后,我似乎无法使

javascript函数重新查询.asp函数与新选择的

图片#... .asp值保持不变,而js值是

正确更改...


任何建议都将不胜感激!

解决方案

http://www.aspfaq.com/2001


-
http://www.aspfaq.com/

(反向回复地址) 。)


" Sue Barth" < Su*@nSytes.com>在消息中写道

news:uB ************** @ TK2MSFTNGP10.phx.gbl ...

大家好,
我希望我能为此做好准备...

我创建了一个允许用户通过
照片目录切换的.asp页面。
该页面完成以下任务:
根据下拉菜单选择照片目录
使用fso获取目录中的照片数量
循环通过照片w前进和后退按钮发送图片
#带有+1或-1值
检索'&从基于数据库的数据库中显示rs'的照片描述字段

尴尬的是页面刷新了自己的请求。
有没有任何方式留在.asp而不刷新?


我发现一些很好的javascript,并将通过
转发&向后按钮,但我似乎无法让javascript将下一张或上一张图片的值发送回.asp函数,该函数从数据库中检索描述字段。我绝对不想为每个目录硬编码
!请原谅我,但我一点也不精通js ...

以前有没有人这样做过,如果有的话,我该如何检索这个价值呢?
我做的一切似乎都没有用。 javascript在初始加载时获取了
.asp代码的值,但在那之后,我似乎无法使
javascript函数重新查询.asp函数新选择的图片#... .asp值保持不变,而js值正确地改变...

任何建议都将不胜感激!



感谢您的回复,Aaron,但令人失望......


您推荐的文章我似乎建议我可以在隐藏的iframe中存储db

值。我会尝试一下。也许我应该通过记录集获得

..asp函数循环并将图片描述存储在

数组中。那么也许有可能让javascript

函数检索隐藏的信息......任何人对此有什么想法?如果

它将有助于看到我想要完成的任务,该网站位于:
http://www.the-jam-factory.com/Forum/default_test.asp (请记住这是

我的测试页面 - 它当前设置了javascript连接到

前进和后退按钮 - 并错误地将记录集信息传递给

图片标题文本框;我没有使用此页面上的下拉菜单。)


其他人对于信息存储在
中的相册做了什么? b $ b数据库?他们是否总是需要刷新页面才能显示新图片?


任何评论,建议,或只是简单的想法欢迎...

=== ===============================================


" Aaron [SQL Server MVP]" < TE ***** @ dnartreb.noraa>在消息中写道

news:uv ************** @ TK2MSFTNGP12.phx.gbl ...

http://www.aspfaq.com/2001

-
http://www.aspfaq.com/
(反向地址回复。)

====================================== ============" Sue Barth" < Su*@nSytes.com>在消息中写道
新闻:uB ************** @ TK2MSFTNGP10.phx.gbl ...

大家好,
我希望我正在为此而努力...

我创建了一个.asp页面,允许用户通过
照片目录切换。
页面完成了以下:
根据下拉菜单选择照片目录
使用fso获取目录中的照片数量
循环通过照片w前进和后退按钮发送
pic#,带有+1或-1值
检索'&根据它的图片显示来自db
的rs'的照片描述字段#

令人尴尬的是页面刷新了自己的
请求。有什么方法可以留在.asp中而不是刷新吗?

我找到了一些很好的javascript,并将通过
前进的图片循环&安培;向后按钮,但我似乎无法让javascript将下一张或上一张图片的值发送回.asp函数,
从数据库中检索描述字段。我绝对不想为每个目录硬编码
!请原谅我,但我一点也不精通js ...

以前有没有人这样做过,如果有的话,我该如何检索
值?我做的一切似乎都没有用。 javascript在初始加载时获取了
.asp代码的值,但在那之后,我似乎无法使
javascript函数重新查询.asp函数新选择的图片#... .asp值保持不变,而js值正确地改变...

任何建议都将不胜感激!




Sue,


在客户端使用JavaScript。


启动计时器和计数变量。

在计时器上设置的每个增量后,

调用一个asp页面counter作为查询字符串parm使用XMLHTTP对象获取数据。

用数据替换innerHTML页面项目

increment下次调用的计数变量。

使用JavaScript和XMLHTTP搜索


HTH


dlbjr

恳求睿智的灌输! />

Hi all,
I hope I''m in the right ng for this...

I made an .asp page that allows users to toggle thru a directory of photos.
The page accomplishes the following:
selects a directory of photos based on a drop down
uses the fso to obtain the # of photos in the directory
cycles thru the photos w forward and backward buttons that send the pic
# with a +1 or -1 value
retrieve''s & displays the rs''s photo description field from a db based
on its pic #

The thing that is awkward is that the page refreshes itself w ea request.
Is there any way to remain in .asp and not refresh?

OR

I found some javascript that is nice and will cycle thru the pics with the
forward & backward buttons, but I can''t seem to make the javascript send the
value of the next or previous pic back to the .asp function that retrieves
the description field from the db. I definitely don''t want to hardcode
these for each directory! And please forgive me, but I am not at all
proficient in js...

Has anyone ever done this before and if so, how can I retrieve that value?
Nothing I''ve done seems to work. The javascript picks up the values of the
..asp code on the initial load, but after that, I can''t seem to make the
javascript functions requery the .asp function with the newly selected
picture #... The .asp values remain the same while the js values are
correctly changing...

Any advice would be greatly appreciated!

解决方案

http://www.aspfaq.com/2001

--
http://www.aspfaq.com/
(Reverse address to reply.)

"Sue Barth" <Su*@nSytes.com> wrote in message
news:uB**************@TK2MSFTNGP10.phx.gbl...

Hi all,
I hope I''m in the right ng for this...

I made an .asp page that allows users to toggle thru a directory of
photos.
The page accomplishes the following:
selects a directory of photos based on a drop down
uses the fso to obtain the # of photos in the directory
cycles thru the photos w forward and backward buttons that send the pic
# with a +1 or -1 value
retrieve''s & displays the rs''s photo description field from a db based
on its pic #

The thing that is awkward is that the page refreshes itself w ea request.
Is there any way to remain in .asp and not refresh?

OR

I found some javascript that is nice and will cycle thru the pics with the
forward & backward buttons, but I can''t seem to make the javascript send
the
value of the next or previous pic back to the .asp function that retrieves
the description field from the db. I definitely don''t want to hardcode
these for each directory! And please forgive me, but I am not at all
proficient in js...

Has anyone ever done this before and if so, how can I retrieve that value?
Nothing I''ve done seems to work. The javascript picks up the values of
the
.asp code on the initial load, but after that, I can''t seem to make the
javascript functions requery the .asp function with the newly selected
picture #... The .asp values remain the same while the js values are
correctly changing...

Any advice would be greatly appreciated!



Thanks for your reply, Aaron, but what a disappointment...

The article you referred me to seems to suggest that I might store the db
values in a hidden iframe. I''ll give that a try. Maybe I should have the
..asp function loop thru the recordset and store the picture descriptions in
an array. Then perhaps it would be possible to have the javascript
functions retrieve that hidden info...Anyone have any thoughts on this? If
it would help to see what I''m trying to accomplish, the site is located at:
http://www.the-jam-factory.com/Forum/default_test.asp (bear in mind this is
my test page - it''s currently set up with the javascript hooked to the
forward and backward buttons - and incorrectly passes the recordset info to
the picture caption textbox; I''m not using the dropdown on this page.)

What do other people do for photo albums that have info stored in a
database? Do they always have to refresh the page to display a new picture?

Any comments, suggestions, or just plain musings welcome...
==================================================

"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl...

http://www.aspfaq.com/2001

--
http://www.aspfaq.com/
(Reverse address to reply.)
================================================== "Sue Barth" <Su*@nSytes.com> wrote in message
news:uB**************@TK2MSFTNGP10.phx.gbl...

Hi all,
I hope I''m in the right ng for this...

I made an .asp page that allows users to toggle thru a directory of
photos.
The page accomplishes the following:
selects a directory of photos based on a drop down
uses the fso to obtain the # of photos in the directory
cycles thru the photos w forward and backward buttons that send the pic # with a +1 or -1 value
retrieve''s & displays the rs''s photo description field from a db based on its pic #

The thing that is awkward is that the page refreshes itself w ea request. Is there any way to remain in .asp and not refresh?

OR

I found some javascript that is nice and will cycle thru the pics with the forward & backward buttons, but I can''t seem to make the javascript send
the
value of the next or previous pic back to the .asp function that retrieves the description field from the db. I definitely don''t want to hardcode
these for each directory! And please forgive me, but I am not at all
proficient in js...

Has anyone ever done this before and if so, how can I retrieve that value? Nothing I''ve done seems to work. The javascript picks up the values of
the
.asp code on the initial load, but after that, I can''t seem to make the
javascript functions requery the .asp function with the newly selected
picture #... The .asp values remain the same while the js values are
correctly changing...

Any advice would be greatly appreciated!




Sue,

Using JavaScript on the Client side.

Start a Timer and a Count Variable.
After each increment you set on the timer,
Call an asp page with the counter Variable as a querystring parm to get data using XMLHTTP object.
Replace innerHTML of page items with data
increment Count variable for next call.

Search using JavaScript and XMLHTTP

HTH

dlbjr
Pleading sagacious indoctrination!


这篇关于我可以将javascript值传递给.asp吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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