![](/img/trans.png)
[英]Load third party js in head tag using angular json + environment based
[英]How to add third party url script and link in the head tag using js?
例如:
var RequestURL = '';
function onWindowClosed(obj) {
/*This is the function where you need to handle callback object based on various codes
If the event name passed by you is not matched with the returned one then you can call the logout functionality, as there are some error occured inside the WEB.
*/
console.log("callback event : " + JSON.stringify(obj));
if (obj.event_name === event_name) {
/*your event is returned here.*/
console.log("successfully returned: " + obj.message);
}
else {
/*handle other event names here. It may be any
unknownEvent,init,capture,initiateAndCapture */
console.log("event not returned");
}
}
var userDetails= JSON.stringify({
"appId": ",
"customerId": "",
"user_type" : "",
"name" : "",
"transaction_date" : "",
"city": "" //optional
// any other parameters on which the response needs to be analyzed should be included here.
});
var params= {
"event_name":"myEvent"
};
您可以使用 vanilla JavaScript 附加腳本或樣式表等元素
var script = document.createElement("script"); script.setAttribute("src", "https://script.example.com/script.js") // Replace with your script link var head = document.querySelector("head") head.appendChild(script)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.