通过url设置html参数选项下拉值
我想通过在 url 中传递默认值来设置网页下拉菜单的默认值。
我想在另一个网页上放置一个链接到该网站,其中:“我希望我的贡献转到:”选项设置为巴基斯坦:月很快洪水,例如通过执行以下操作:
http://donate.ifrc.org/?desc=Pakistan:季风洪水,
但这似乎不起作用。有任何想法我都想发布这个链接,让尽可能多的人捐款。谢谢。
~f
I would like to set the default of a drop-down menu of a webpage by passing the default value in the url.
Id like to put a link on a another webpage to this site where the: "I would like my contribution to go to:" option is set to Pakistan: moonsoon floods e.g. by doing something like:
http://donate.ifrc.org/?desc=Pakistan: monsoon floods
but this doesnt seem to work. Any ideas i want to put up this link to get as many people to donate as possible. Thanks.
~f
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除非您链接到的网站在其页面上专门包含了支持它的代码,否则您将无法通过更改 URL 来控制其网站的执行方式。
如果您尝试在自己的网站上执行此操作,则可以通过引用您构建网站所用的任何服务器端语言的查询字符串参数来轻松完成此操作,或者通过 Javascript 在客户端上执行此操作。但无论哪种情况,站点本身都会控制它如何响应 URL,而不是相反。
Unless the site you are linking to has specifically included code on their pages to support it, you are not going to be able to control how their site performs by changing the URL.
If you were trying to do this on your own site, you could easily do it by referencing the querystring parameters in whatever server-side language you built the site with, or on the client-side via Javascript. But in either case, the site itself controls how it responds to a URL, not the other way around.