通过GET或POST提交超链接 [英] submitting a hyperlink by GET or POST

查看:243
本文介绍了通过GET或POST提交超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以有这个超链接 - 它很高兴成为一个超链接 - 它不想改变为按钮或表单元素 - 它想保持链接!

但如果我可以通过GET或POST提交它(这是我根据设计标准切换页面的内容),它确实会对我有所帮助。是否有任何方法可以做到这一点



感谢
Giles

解决方案

div>

你很幸运......点击一个超链接已经做了一个GET请求。



如果您想添加查询参数,请将它们追加到查询字符串中,如下所示:

 < a href =/ my / page / foo.php?onions = no& pickles = yes>链接文字< / a> 


So there's this hyperlink - it's happy being a hyperlink - it does not want to change to a button or a form element - it wants to stay a link!

But it would really help me if I could submit it via GET or POST (something which I switch on my pages due to design criteria). Is there ANY way that I can do this

thanks Giles

解决方案

You're in luck... clicking a hyperlink already does a GET request.

If you want to add query parameters, append them to the query string like so:

<a href="/my/page/foo.php?onions=no&pickles=yes">link text</a>

这篇关于通过GET或POST提交超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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