鍍金池/ 問答/HTML/ js script標(biāo)簽發(fā)送跨域請(qǐng)求,沒進(jìn)入回調(diào)是什么原因?

js script標(biāo)簽發(fā)送跨域請(qǐng)求,沒進(jìn)入回調(diào)是什么原因?

<script
type="text/javascript"
defer="defer"
src="http://localhost:8080/cqpt/ueditor/exec?action=config&callback=bd__editor__e3zw61"

</script>
使用script 標(biāo)簽發(fā)送 這樣的一個(gè)請(qǐng)求
http://localhost:8080/cqpt/ueditor/exec?action=config&callback=bd__editor__e3zw61
Window對(duì)象上也掛載了著個(gè)方法

clipboard.png

后臺(tái)請(qǐng)求接受成功,并返回json格式的數(shù)據(jù),

但是前臺(tái)始終接受不到 返回的信息,這是什么情況?

使用的ueditor dojsonp的方法

返回的數(shù)據(jù)格式
{

"videoMaxSize":102400000,
"videoActionName":"uploadvideo",
"fileActionName":"uploadfile",
"fileManagerListPath":"/ueditor/jsp/upload/file/",
"imageCompressBorder":1600,
"imageManagerAllowFiles":[],
"imageManagerListPath":"/ueditor/jsp/upload/image/",
"fileMaxSize":51200000,
"fileManagerAllowFiles":[],
"fileManagerActionName":"listfile",
"snapscreenInsertAlign":"none",
"scrawlActionName":"uploadscrawl",
"videoFieldName":"upfile",
"imageCompressEnable":true,
"videoUrlPrefix":"",
"fileManagerUrlPrefix":"",
"catcherAllowFiles":[],
"imageManagerActionName":"listimage",
"snapscreenPathFormat":"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"scrawlPathFormat":"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"scrawlMaxSize":2048000,
"imageInsertAlign":"none",
"catcherPathFormat":"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"catcherMaxSize":2048000,
"snapscreenUrlPrefix":"",
"imagePathFormat":"/uploadfile/{yyyy}{mm}{dd}/{time}{rand:6}",
"imageManagerUrlPrefix":"",
"scrawlUrlPrefix":"",
"scrawlFieldName":"upfile",
"imageMaxSize":2048000,
"imageAllowFiles":[],
"snapscreenActionName":"uploadimage",
"catcherActionName":"catchimage",
"fileFieldName":"upfile",
"fileUrlPrefix":"",
"imageManagerInsertAlign":"none",
"catcherLocalDomain":[],
"filePathFormat":"/ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}",
"videoPathFormat":"/ueditor/jsp/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}",
"fileManagerListSize":20,
"imageActionName":"collect/uploadFile",
"imageFieldName":"upfile",
"imageUrlPrefix":"http://127.0.0.1:8080/cqpt",
"scrawlInsertAlign":"none",
"fileAllowFiles":[],
"catcherUrlPrefix":"",
"imageManagerListSize":20,
"catcherFieldName":"source",
"videoAllowFiles":[]

}

回答
編輯回答
慢半拍

信息不足。

  1. 在可疑位置逐行console.log
  2. 查看開發(fā)者工具的網(wǎng)絡(luò)標(biāo)簽,檢查該請(qǐng)求的內(nèi)容。
2017年11月7日 18:19
編輯回答
吃藕丑

后端給你拼的字符串是啥,可以發(fā)出來嗎,結(jié)構(gòu)發(fā)出來就行
讓后端拼這樣一個(gè)字符串給前端

bd__editor__e3zw61(
  //你現(xiàn)在返回的對(duì)象 {巴啦巴拉一堆數(shù)據(jù)}
)

你的請(qǐng)求中是帶了bd__editor__e3zw61這個(gè)名字的,讓后端給你拼下就行了

2017年11月10日 07:37
編輯回答
囍槑

是不是返回的東西有問題,就是返回的腳本里面只是聲明了bd__editor__e3zw61這個(gè)函數(shù)但是并沒有執(zhí)行

2017年5月22日 03:06