FetchJsonp reported an error

try {

fetchJsonp("xxx.php", {
    headers: {
        "Content-Type":"application/json"
    },
    jsonpCallbackFunction: "portraitCallBack"
})
;
let dataS = promise.json();
console.log(dataS);
dataS.then(data => {
    console.log(data);

})

} catch (error) {

console.log(error)

}
I use fetchJsonp, when doing cross-domain work, but I report an error. Does fetchJsonp undefined, need to import other files? please advise

Apr.07,2021

< script src= "https://cdn.bootcss.com/fetch-jsonp/1.1.3/fetch-jsonp.min.js"></script>


I haven't used this before. I don't know where you saw this method.
here is the official document https://github.com/camsong/fe.
follows the instructions for the use of most plug-ins and needs to be installed first, and then introduced to use

.
npm install fetch-jsonp


import fetchJsonp from 'fetch-jsonp';
Menu