var id = $("input#user_id").val();
if (id != "") {
$.post("function.php?act=check_id", { id: id }, function(data) {
if (data == "error") {
return false;
}
});
//some other codes going on here....
正如你所看到的,我试图将
我有一个注释表格,它在提交时将数据插入到数据库中。以下是守则;
function reloadRecaptcha() {
var publicKey = "*************************************";
var div = "recap";
Recaptcha.create(publicKey,div,{theme: "white"});
return false;
}
function validateForm() {
var x=document.forms["
这里有一些复杂的jQuery和PHP问题。在我的index.php上,调用javascript函数getCalls()。
function getCalls()
{
$('#transportDiv').load('getCalls.php');
}
getCalls.php从SQL数据库中进行选择。它返回一个包含请求数据的表,加上为每一行动态生成的表单,以及为每个动态生成的表单动态生成的jQuery post函数(顺便说一句,它们是echo()'d ):
<tr>
//Static table data here
<
因此,在提交我的表单类.login时,这将触发对login.php的ajax调用,在login.php内部,有一个对welcome.php的调用,以确保加密的密码与数据库中的密码匹配,并且输入的用户名在数据库中存在。提到我的ajax调用在尝试运行时成功了,但是没有重定向到我的welcome.php,这也会很有帮助。所以,我要问你们的是,我是不是走对了方向?
$('.login').on('submit', function(){
// serialize the form
var formData = $(this).seria
我有一个ajax:
function sendData() {
var question = (document.getElementById('question').value).toString();
var c = (document.getElementById('c').value).toString();
$.ajax({
url: '/Home/InsertData',
type: 'POST',
data: {question:question
我在Django中将线程库用于一个长时间运行的进程。流程完成后,我希望不断更新前端的进度状态。我无法从我的线程函数向ajax.get()发送任何内容。 View.py def upload_handler(request, file_loc, filename):
// do something with uploaded
// I want to notify user that this process is complete via a post
class Uploader(View):
def get(self, request):
file
我使用基于类的视图和get和post方法。
class MyView(View):
def get(self,request, *args, **kwargs):
#some code
def post(self,request, *args, **kwargs):
#update some data which is used in the view
return redirect('app:my-view')
这方面的问题是,django在重定向之后不会重新执行get方法( GET请求可以在firebug中得到