关于将数据发布到不同的网站 [英] Regarding Posting data to different website
本文介绍了关于将数据发布到不同的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请参阅以下代码:
document .getElementById( ' order')。action = https://pilot-payflowlink.paypal.com;
document .getElementById(' order').method = ' post';
var form = document .getElementById(' order');
form.setAttribute(' target', ' iframe1');
form.submit()
return ( true );
以上代码正常运行,发布到贝宝。
但是以下代码无效。请帮帮我。
document .getElementById(' order')。action =<%= this .postUrl %> ;
document .getElementById(' order').method = ' post';
var form = document .getElementById(' order');
form.setAttribute(' target', ' iframe1');
form.submit()
return ( true );
受保护 string postUrl { get ; set ; }
this .postUrl = ConfigurationManager.AppSettings [ POSTURL跨度>];
这里值 即将到来。
<%= this.postUrl%>
这似乎什么都不做。
当我写作 <%#this.postUrl%>
而不是<%= this.postUrl%>
我在使用提醒时显示未定义查看值。
解决方案
您好b $ b尝试将脚本部分表单标题标记移动到正文标记中
< head >
< title > < / title >
< script > < / script > ----在此处删除表单
< / head >
< 正文 >
< script > < / script > ----在此添加
< 表格 > < / form >
< / body > 跨度>
See the below code :
document.getElementById('order').action = "https://pilot-payflowlink.paypal.com";
document.getElementById('order').method = 'post';
var form = document.getElementById('order');
form.setAttribute('target', 'iframe1');
form.submit()
return (true);
Above code is working, it is posting to paypal.
But the below code is not working. Please help me out.
document.getElementById('order').action = <%=this.postUrl %>;
document.getElementById('order').method = 'post';
var form = document.getElementById('order');
form.setAttribute('target', 'iframe1');
form.submit()
return (true);
protected string postUrl { get; set; }
this.postUrl = ConfigurationManager.AppSettings["POSTURL"];
Here value is coming.
<%=this.postUrl %>
this seems to be doing nothing.
When i am writing <%#this.postUrl %>
instead of <%=this.postUrl %>
undefined is showing when i am using alert to see the value.
解决方案
Hi Try to move ur script part form header tag inside to body tag
<head> <title></title> <script></script> ----Remove form here </head> <body> <script></script> ---- add here <form></form> </body>
这篇关于关于将数据发布到不同的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文