du060334 2012-05-21 04:28
浏览 119

按钮点击获取请求

here is the challenge, I have a webpage, with a form in it , and the button that corresponds to it of course causes a submit. The other button that I have, essentially must trigger a database call that displays content from the database, on this page.

So technically my mind understands that this button should send a GET request to the server and then I retrieve the necessary information and it is displayed. But syntactically, I do not understand how to pull this off, one way to go about doing it is to encapsulate this button in another form, that has a method called GET, and in my server side, I retrieve my information, encode it and send it back to the client. But the idea of encoding this inside a form does not appeal to me as this isn't a form, all I really want to understand is how I can trigger the GET method by clicking a button.

Thanks!

  • 写回答

1条回答 默认 最新

  • dptrmt4366 2012-05-21 04:33
    关注

    There are two simple ways to send a GET request. One is as you figured out, a new form that has that button as an input and nothing is wrong with that so I'm not sure what is not appealing to you. The second way could be via link, for example:

    <a href="somesite.php?something=value">Link</a>
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度