English 中文(简体)
与 jQuery ajax 员额有关的问题
原标题:Issue with jQuery ajax post

这是对这个 < a href=> 问题 问题 的后续。因为我现在面临的问题与现在的问题不同,我想我会提出一个新的问题。

我对以下代码有异议, 请求在其中获取 POPST 服务器, 但服务器发送的任何回复都无法在浏览器上看到( 以此处提醒的形式 ) 。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
    $( #login ).delegate( input#submit , click ,function(){
        var request = $.ajax({
            type: "POST",
            url: "login",
            data: {userid: $("#userid").val(), password:$("#password").val()},
            datatype: "xml",
            cache: false,
            success: function(xml){alert(xml);}
        });
    });
});

</script>

我可以看到,这个请求将发送到服务器 - 可以在日志中看到。 但我在浏览器中看不到服务器的反应。 这里显示服务器的反应 :

<result><url>landing-page</url></result>

我不知道我做错了什么,但是这似乎是一件简单的事情,我应该让它顺利地工作。我尝试过Firebug,但运气不好。不管我在哪里犯错,或如何进一步调试这个问题。

谢谢 谢谢

最佳回答

要么将您的“ 成功” 回调改为“ 完全” 回调, 要么添加一个完整的回调 。 我的猜测是, 它没有检测到“ 成功”, 尽管响应正在成功检索 。 如果它点燃了“ 完全” 回调, 那么您就可以尝试修正您的网络服务, 以提供一个成功响应 。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签