I'm developing an HTML5 Application. In my application, there is one page for posting the user comments.There is a submit button. I'm getting the following set of values {BrandId,ForumId,Title,Description}, which needs to be appended with url string for POST Request. In my submit method,I have written code for ajax POST call as,
我正在开发一个HTML5应用程序。在我的应用程序中,有一个用于发布用户评论的页面。有一个提交按钮。我得到以下一组值{BrandId,ForumId,Title,Description},需要附加POST请求的url字符串。在我的提交方法中,我已经为ajax POST调用编写了代码,
$.ajax({
type:"POST",
url: "myURL", // the appended url with above 4 values
dataType: "jsonp",
success: function(result)
{
alert("success in posting data");
}
});
But this is not showing "success". Can anyone guide me to successfully implement post request for posting the data to the server.
但这并没有表现出“成功”。任何人都可以指导我成功实现将数据发布到服务器的发布请求。
Thanks.
1 个解决方案
#1
0
If you want to submit your data by appending them to your url, you need to do a get request.
如果您想通过将数据附加到您的网址来提交数据,则需要执行获取请求。
If you want to use a post request like in your exemple, you need to tell the ajax function which data to send
如果你想使用像你的例子中的post请求,你需要告诉ajax函数要发送哪些数据
#1
0
If you want to submit your data by appending them to your url, you need to do a get request.
如果您想通过将数据附加到您的网址来提交数据,则需要执行获取请求。
If you want to use a post request like in your exemple, you need to tell the ajax function which data to send
如果你想使用像你的例子中的post请求,你需要告诉ajax函数要发送哪些数据