开发者

Ajax responseText in plain text [jQuery + jQuery Form Plugin]

Im trying to make a form with ajaxForm from jQuery Form Plugin.

    var options = { 
    target:        '#output',   // targ开发者_高级运维et element(s) to be updated with server response 
    beforeSubmit:  beforePost,  // pre-submit callback 
    success:       successPost,  // post-submit callback 
    url:       './registerEntry.php',        // override for form's 'action' attribute 
    type:      'post',        // 'get' or 'post', override for form's 'method' attribute 
    dataType:  null,        // 'xml', 'script', or 'json' (expected server response type) 
    clearForm: true,       // clear all form fields after successful submit 
    timeout:   3000 
}; 

$('#registerEntry').ajaxForm(options); 

When Im trying to alert the responseText but the script keeps adding HTML-taggs in it. the registerEntry.php contains only 'hello' in plain text but the response is 'hello'.

How can I get the response in plain text?


Have you tried dataType: 'text' ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜