如何读取页面返回的响应? [英] How to read response returned by a page?

查看:87
本文介绍了如何读取页面返回的响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!



我有一个由asp classic制作的网站。它有一个表单,将动作发送到某个网站。然后该网站将发回一个。



这是我发送邮件的方式。



<表格name ='postURL'action''URL'method ='post'>

< input type =textname =Param1value =''/>

< input type =textname =Param2value ='<'/>

< input type =textname =Param3 value =''/> < / form>



发布后。我的网站将被重定向到一个新的URL:

并显示如下内容:

{resultCode:000,resultMsg:成功, txnToken:cRmQsu1JV81eacb78f82da}



我的问题是如何获得响应而不重定向这个新URL?



感谢您的反馈。



谢谢。



我是什么尝试过:



这是我的代码



< form name ='postURL 'action ='URL'method ='post'>

< input type =textname =Param1value =''/>

< input type =textname =Param2value ='<'/>

< input type =textname =Param3 value =''/> < / form>

Hi!

I have a website made from asp classic. it has a form that will send action to a certain website. then the website will send a return.

this is how i send post.

<form name='postURL' action='URL' method='post'>
<input type="text" name="Param1" value= ''/>
<input type="text" name="Param2" value='<'/>
<input type="text" name="Param3" value=''/> </form>

after posting. my site will be redirected to a new URL:
and display something like this:
{"resultCode":"000","resultMsg":"Success","txnToken":"cRmQsu1JV81eacb78f82da"}

my question is how do a get the response without redirecting this a new URL?

appreciate your feedback guys.

Thank you.

What I have tried:

here is my code

<form name='postURL' action='URL' method='post'>
<input type="text" name="Param1" value= ''/>
<input type="text" name="Param2" value='<'/>
<input type="text" name="Param3" value=''/> </form>

推荐答案

最简单的方法是使用jQuery并执行ajax调用并使用complete事件来检查返回的状态,或者如果您只对成功或失败感兴趣,那么请使用相关事件



jQuery.ajax()| jQuery API文档 [ ^ ]



如果您谷歌如何发布带有jquery ajax的表单,您应该找到如何阅读表单变量并发布它们的示例。
Easiest way will be to use jQuery and do an ajax call and use the "complete" event to examine the status that is returned, or if you're only interested in success or failure then use the relevant events for that

jQuery.ajax() | jQuery API Documentation[^]

If you google how to post a form with jquery ajax you should find examples of how to read the form variables and post them.


这篇关于如何读取页面返回的响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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