Usage of then () in JavaScript

CSDN Q & A 2022-02-13 05:55:34 阅读数:986

usage javascript

When calling print , Encounters an error , Who can analyze it
var officeTransIframeDom=_getOfficeIframe();
document.getElementsByTagName("iframe")[0];
var wpsTransType = isWpsTrans();

if(wpsTransType){ popupContentWin(content,dataFormat,createDate,userId,ext,title,isForm).then(function () { var interval = setInterval(function () { ocxPrint = true; OfficeAPI.officePrint(); clearInterval(interval); },500); }) return 0;}

img




Take the answer :

What's wrong ,then Is the method encapsulated by yourself .



Other answers 2:

Only Promise Objects can only be used then
Create a Promise Examples of objects are as follows

const promise = new Promise(function(resolve, reject) { // ... some code if (/* Asynchronous operation succeeded */){ resolve(value); } else { reject(error); }});

Examples of use

promise.then(function(value) { // success}, function(error) { // failure});

Other answers 3:

popupContentWin(content,dataFormat,createDate,userId,ext,title,isForm)
Print the returned data


Other answers 4:

popupContentWin(content,dataFormat,createDate,userId,ext,title,isForm) What is returned

copyright:author[CSDN Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130555320955.html