动态查询字符串变量? [英] Dynamic Query String Variables?

查看:80
本文介绍了动态查询字符串变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个相当复杂的预订系统,用于构建欧洲

旅行,结合使用SQL / VBScript / Javascript。有大量的

查询字符串变量可以在

页面之间来回传递,而且在几乎所有情况下,我都可以将它们设置得很好,前提是

变量在链接中。


*保存*的页面虽然有问题。


一个示例旅行可能包括两个欧洲城市或城镇,每个公寓或小屋中有一周

,用户从十几个b $ b或每个属性中选择区域。


所有信息都在一个页面上(每周几十个属性为
,旅行的可用日期和每个,最大入住
每个房产
,每个房产的价格和每位乘客的数量,

等......实际预订行程所需的一切)。如果用户

更改了聚会规模或选择了日期,则会隐藏或显示属性

,具体取决于最大占用率和/或可用性。


因此,用户设置他们的日期和派对大小(或者只是派对

大小,或者可能刚刚清除了所有内容以重新开始...)然后

想要查看可用的属性,以便他们可以找到他们喜欢的属性。

当前pax / date / etc.信息不在查询变量中,因为链接是在运行时构建的。


如果我在onclick事件中构建链接,如果有人打破了正确

点击以打开新页面或标签。


我讨厌禁用右键菜单的网站。我讨厌网站,当你用右键单击打开一个新页面时,如果使用onclick事件创建了URL,则会生成一个javascript

错误。我讨厌使用

onclick来调出页面意味着

状态栏中显示的内容与
时显示的页面没有任何相似之处
你点击链接。


我的客户并不担心这个用户的非JavaScript用户;

这些人是提到了一个免费的spiffy目录,坦率地说,这个客户的大多数客户都预定了他们的旅行。我只是

希望能够以这样一种方式携带变量,如果有人右击,就不会破坏网站。


有人有什么建议吗?是否无望?


谢谢,


朱莉

I''m working on a rather complex booking system for building European
trips, in a combination of SQL/VBScript/Javascript. There are tons of
query string variables that get passed back and forth between the
pages, and in almost every case, I can set ''em up fine, provided the
variables are in the link.

The page the *holds* the booking information, though, is problematic.

An example trip might include two European cities or towns with a week
in each in an apartment or cottage that the user selects from a dozen
or properties for each region.

All the information is on one page (all the dozen or so properties for
each weeks, available dates for the trip and for each , max occupancy
per property, pricing per property and per number of passengers,
etc...everything necessary to actually book the trip). If the user
changes party size or chooses a date, properties are hidden or shown
depending on max occupancy and/or availability.

So, a user sets their date and party size (or maybe just the party
size, or maybe has just cleared everything out to start over...) then
wants to view available properties so they can find one they like. The
current pax/date/etc. information is not in the query variables,
because the link was built at runtime.

If I build the link in an onclick event, it breaks if someone right
clicks to open a new page or tab.

I hate sites that disable right click menu. I hate sites where, when
you open a new page with a right click, it generates a javascript
error if the URL is created with an onclick event. I hate that using
an onclick to bring up the page means whatever is showing in the
status bar bears no resemblance to the page that is brought up when
you click on the link.

My client isn''t worried about the non-javascript people for this use;
those people are referred to a free spiffy catalog, which frankly, is
how most of this client''s customers book their trip anyway. I just
want to be able to carry the variables in such a way as to not break
the site if someone right clicks.

Anybody have any suggestions? Is it hopeless?

Thanks,

Julie

推荐答案

ju**********@gmail.com 写道:

因此,用户设置他们的日期和派对大小(或者只是派对

大小,或者可能刚刚清除了所有内容重新开始...)然后

想要查看可用的属性,以便他们可以找到他们喜欢的属性。

当前pax / date / etc.信息不在查询变量中,因为链接是在运行时构建的。
So, a user sets their date and party size (or maybe just the party
size, or maybe has just cleared everything out to start over...) then
wants to view available properties so they can find one they like. The
current pax/date/etc. information is not in the query variables,
because the link was built at runtime.



这是一个导致问题的设计错误。您可以轻松构建

包含客户端变量的链接。

That''s a design error which causes your problem. You can easily build
the link to contain your client-side variables, then.


如果我在onclick事件中构建链接,如果有人正确点击它会打破

点击打开新页面或标签页。


我讨厌禁用右键菜单的网站。
If I build the link in an onclick event, it breaks if someone right
clicks to open a new page or tab.

I hate sites that disable right click menu.



不要这样做,然后。

Don''t do that, then.


我讨厌网站,当你打开一个右键单击的新页面,如果使用onclick

事件创建URL,则
会生成javascript错误。
I hate sites where, when you open a new page with a right click, it
generates a javascript error if the URL is created with an onclick
event.



这些网站的设计也很糟糕。

Those sites are badly designed, too.


我讨厌使用onclick调出来页面意味着什么是状态栏中显示的
与点击链接时显示的页面没有任何相似之处


I hate that using an onclick to bring up the page means whatever is
showing in the status bar bears no resemblance to the page that is
brought up when you click on the link.



如果有状态栏的话。

If there even is a status bar.


我的客户并不担心非-javascript用户可以使用这个用户;

这些人被称为免费的spiffy目录,坦率地说,是这个客户的大多数客户如何预订他们的旅行。我只是

希望能够以这样的方式携带变量,如果有人点击右键,就不会破坏网站的价值。
My client isn''t worried about the non-javascript people for this use;
those people are referred to a free spiffy catalog, which frankly, is
how most of this client''s customers book their trip anyway. I just
want to be able to carry the variables in such a way as to not break
the site if someone right clicks.



或左键单击。你知道,有左撇子的人。

或Compose / Menu键按下。有键盘。

或者......

Or left-clicks. There are left-handed people, you know.
Or Compose/Menu key presses. There are keyboards.
Or ...


有人有什么建议吗?这是绝望的吗?
Anybody have any suggestions? Is it hopeless?



不,您可以使用仅通过脚本增强的可访问链接:


< a href =" ..."的onclick = QUOT;任何();返回false;"> ...< / a>


首先应该做的是什么。

HTH


PointedEars

-

"使用任何版本的Microsoft Frontpage创建您的网站。 (这不会是b $ b阻止人们查看你的来源,但是没有人会想要窃取它。)"

- 来自< http:// www.vortex-webdesign.com/help/hidesource.htm>

No, you can use an accessible link that is only enhanced with script:

<a href="..." onclick="whatever(); return false;">...</a>

Which is what you should have done in the first place.
HTH

PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won''t
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>


9月20日上午11点58分,Thomas''PointedEars''Lahn< PointedE .. 。@ web.de>

写道:
On Sep 20, 11:58 am, Thomas ''PointedEars'' Lahn <PointedE...@web.de>
wrote:

julie.sie ... @ gmail.com写道:
julie.sie...@gmail.com wrote:

因此,用户设置他们的日期和派对大小(或者只是派对

大小,或者可能刚刚清除了所有内容以重新开始......)然后

想要查看可用的属性,以便他们可以找到他们喜欢的属性。

当前pax / date / etc.信息不在查询变量中,因为链接是在运行时构建的。
So, a user sets their date and party size (or maybe just the party
size, or maybe has just cleared everything out to start over...) then
wants to view available properties so they can find one they like. The
current pax/date/etc. information is not in the query variables,
because the link was built at runtime.



这是一个导致问题的设计错误。您可以轻松地构建

链接以包含您的客户端变量。


That''s a design error which causes your problem. You can easily build
the link to contain your client-side variables, then.



这是客户想要的设计。

This is the design the the client wants.


不,你可以使用一个可访问的链接仅通过脚本增强:


< a href =" ..."的onclick = QUOT;任何();返回false;"> ...< / a>


这是你应该首先做的。
No, you can use an accessible link that is only enhanced with script:

<a href="..." onclick="whatever(); return false;">...</a>

Which is what you should have done in the first place.



这就是我现在所拥有的,这就是问题所在。如果用户右键点击

打开一个新页面,他们将获得HREF标签中的页面,其中

不反映他们在预订中所做的更改,因为onclick

事件没有开火。


禁用右键会解决问题,但我不会那样做,

我也不会将链接转换为javascript :void或其他任何内容。


我可以将链接按钮转换为表单提交按钮,所以他们不能通过右键单击
覆盖它,但这并不能很好地使用Form

命令,而且页面已经非常复杂了。


我可以将链接转到一个页面,上面写着请不要使用

右击,因为我们无法跟踪你所选择的日期和派对大小

,这可能是我所做的,如果所有其他方法都失败了...但是状态

吧(对于那些有一个,和看这样的东西 - 我有,我做的)

将读取类似dontrightclick.html的内容。 - 大声笑 - 这不是很好的b $ b很好。


因为我不能动态地将查询变量添加到href URL,我想

我要尝试将div中的链接包起来并使用inner.html并尝试

当日期或派对大小发生变化时重写整个DIV。这是我能想到的更新URL的唯一方式。可能会工作......如果没有,我会猜测他们会被一个页面解释为什么他们不能这样做。


谢谢,


Julie

This is what I have now, that''s the problem. If a user right clicks to
open a new page, they will get the page in the HREF tag, which does
not reflect the change they made in their booking, because the onclick
event doesn''t fire.

Disabling the right click would fix the problem, but I won''t do that,
nor will I turn the link into a javascript: void or whatever that is.

I could turn the link button into a form submit button, so they can''t
override it with a right click, but that is not good use of the Form
command, and the page is already pretty complex.

I could just make the links go to a page that says "Please don''t use
right click, because we can''t track your selected date and party size"
and that is probably what I do if all else fails...but then the status
bar (for those who have one, and watch such things - I have, and I do)
will read something like "dontrightclick.html" - lol - which is not
great either.

Since I can''t add query variables dynamically to the href URL, I think
I''m going to try wrap the link in a div and use inner.html and try
rewriting the entire DIV when the date or party size changes. It''s the
only way I can think of to update the URL. Might work...if not, I
guess they are stuck with a page explaining why they can''t do this.

Thanks,

Julie


" ju ********** @ gmail.com" < ju ********** @ gmail.comwrote in

新闻:11 ********************* @ r29g2000hsg.googlegro ups.com:
"ju**********@gmail.com" <ju**********@gmail.comwrote in
news:11*********************@r29g2000hsg.googlegro ups.com:

9月20日上午11点58分,Thomas''PointedEars''Lahn< PointedE ... @ web.de> ;

写道:
On Sep 20, 11:58 am, Thomas ''PointedEars'' Lahn <PointedE...@web.de>
wrote:

> julie.sie ... @ gmail.com写道:
>julie.sie...@gmail.com wrote:

因此,用户设置他们的日期和派对大小(或者只是派对

大小,或者可能刚刚清除了所有内容以重新开始...)

然后想要查看可用的属性,这样他们就可以找到他们喜欢的b $ b。当前的pax / date / etc.信息不在查询中,因为链接是在运行时构建的。
So, a user sets their date and party size (or maybe just the party
size, or maybe has just cleared everything out to start over...)
then wants to view available properties so they can find one they
like. The current pax/date/etc. information is not in the query
variables, because the link was built at runtime.


这是一个导致问题的设计错误。您可以轻松地构建包含客户端变量的链接。


That''s a design error which causes your problem. You can easily
build the link to contain your client-side variables, then.



这是客户想要的设计。


This is the design the the client wants.



我不确定我是否完全关注你,但使用AJAX可能是一个很好的

情况 - don不要在运行时加载所有信息,然后将

加载到页面中(隐藏表单字段?),因为选择是由

用户进行的。


即:用户选择日期,AJAX点击数据库以提取该日期可用的物品

。他们改变日期?相同的AJAX调用获取

适当的信息。派对大小等同样的事情......

I''m not sure I''m totally following you, but perhaps this is a great
situation for using AJAX - don''t load all the information at runtime, load
them into the page (hidden form fields?) as selections are made by the
user.

ie: user chooses a date, AJAX hits the database to pull up properties
available on that date. They change the date? The same AJAX call gets the
appropriate info. Same thing for party-size, etc...


这篇关于动态查询字符串变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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