我有以下......
chrome.extension.sendRequest({
req: "getDocument",
docu: pagedoc,
name: 'name'
}, function(response){
var efjs = response.reply;
});
Run Code Online (Sandbox Code Playgroud)
它调用以下..
case "getBrowserForDocumentAttribute":
alert("ZOMG HERE");
sendResponse({
reply: getBrowserForDocumentAttribute(request.docu,request.name)
});
break;
Run Code Online (Sandbox Code Playgroud)
但是,我的代码永远不会到达"ZOMG HERE",而是在运行时抛出以下错误 chrome.extension.sendRequest
Uncaught TypeError: Converting circular structure to JSON
chromeHidden.JSON.stringify
chrome.Port.postMessage
chrome.initExtension.chrome.extension.sendRequest
suggestQuery
Run Code Online (Sandbox Code Playgroud)
有谁知道是什么原因引起的?
我有一个包含子文档数组的文档:
{
"company": "test plc",
"address": [
{
"addr1": "37",
"addr2": "",
"addr3": "test",
"addr4": "",
"addrcity": "",
"addrcounty": "test",
"addrpostcode": "test"
},
{
"addr1": "37",
"addr2": "",
"addr3": "test",
"addr4": "",
"addrcity": "",
"addrcounty": "test",
"addrpostcode": "test"
},
{
"addr1": "37",
"addr2": "",
"addr3": "test",
"addr4": "",
"addrcity": "",
"addrcounty": "test",
"addrpostcode": "test"
}
],
"contacts": [
{
"name": "test",
"surname": "testing",
"title": "master"
},
{
"name": "test",
"surname": "testing",
"title": "master"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我想做的是通过搜索contacts.surname属性返回文档列表。
var …Run Code Online (Sandbox Code Playgroud)