我有一个QT webkit HTML5应用程序,带有一个调用jQuery AJAX POST方法的按钮
<script>
$(document).ready(function(){
$('#bntLogin').click(function(){
var usrn = $('#txtUsername').val();
var pwd = $('#txtPassword').val();
$.ajax({
url: 'http://www.ngg-l.com/Account/ClientLogin/',
type: 'POST',
data: { username: usrn, password: pwd },
dataType: 'json',
success: function (result) {
alert(result);
},
error: function(xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError);
}
});
});
});
</script>
xhr.status = 0
有谁知道为什么我的ajax无效?
答案 0 :(得分:0)
您可以尝试致电:
QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);