本文介绍了显示jQuery jsonp回调结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
抱歉,我的问题愚蠢而基本....
Sorry as my question stupid and elementary....
如何将jsonp回调结果写到页面,我正在尝试用jQuery这样但结果-数据已保存:[对象对象]
how write jsonp callback result to page, I'm trying such with jquery but result - Data Saved: [object Object]
function alertResponse(text) {
document.write( "Data Saved: " + text );
}
$.ajax({
url: URL,
dataType: 'jsonp',
jsonpCallback: 'alertResponse'
});
URL引起的骚动是
jsonp1293628807768({"text":" <div class=\"package_search_result_table\" 710px>\r\n <div class=\"itt_title\" style=\"width: 710px;\">\r\n
推荐答案
您可以使用 JSON 库和它是显示文字的JSON.stringify
函数.
You can use JSON library and it's JSON.stringify
function to display the text.
这篇关于显示jQuery jsonp回调结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!