硅基本上是你的JS代码就可以了,
首先需要创建一个JS代码,并将其托管到一些服务器通过获取它得到它,所以像你的JS代码托管到https://www.mygreatjscode.com/myjscode.js
所以,你的JS代码会做休息,
这样使用纯JS(含未如jQuery等框架),让您的myjscode.js
文件将包含此:
//create an autoexec function
(function(){
var body = document.getElementByTagName("body");
body = body ? body : false;
if (body){
var iframe = document.createElement("iframe");
iframe.setAttribute("id", "MY_CUSTOM_ID");
//here set the url that the iframe will be render
iframe.setAttribute("src", "https://stackoverflow.com/");
//finally insert into the body of page
body.appendChild(iframe);
}
})();
最后,您需要将脚本标记插入到您的网页中,就像这样
<script src="https://www.mygreatjscode.com/myjscode.js" data-customer="14532"></script>