window.alert = function (obj) {
	var iframe = document.createElement('iframe');
	iframe.src = 'javascript:void(0);'
	document.body.appendChild(iframe)
	iframe.contentWindow.alert(obj);
	iframe.parentNode.removeChild(iframe);
}

window.hugo={}
window.hugo.iframes=[]
let iframes=window.hugo.iframes;
var openIframe=function(html,body){
	// 1. 创建<iframe>元素
	var ifr = document.createElement('iframe');
//	// 2. 将CSS,HTML字符串转换为Blob对象
//	var blob = new Blob([html], {
//	  'type': 'text/html'
//	});
//	// 3. 使用URL.createObjectURL()方法将...
//	iframe.src = URL.createObjectURL(blob);
	body.innerHTML = "";
	body.appendChild(ifr);
	var ifrw = (ifr.contentWindow) ? ifr.contentWindow: (ifr.contentDocument.document) ? ifr.contentDocument.document: ifr.contentDocument;
	ifrw.document.open();
	ifrw.document.write(html);
	ifrw.document.close();
	//console.log(x)
}
//开启页面html
{

    let xx = $("#cnblogs_post_body,.cnblogs-post-body").find("[data-type=html]");
    let xxx = [];
    for (let x of xx) {
        xxx.push(x.innerText)
    };
    xx.remove();
    let URL = window.URL || window.webkitURL;
    for (let x of xxx) {
		//openIframe(x,document.body)
		iframes.push(x);
    };
}

我的随笔

上一页 1 ··· 3 4 5 6 7 8 9 下一页
离线云 2020-08-21 13:11 阅读:6166 评论:0 推荐:0
离线云 2020-08-19 17:07 阅读:1353 评论:0 推荐:0
离线云 2020-07-27 19:19 阅读:603 评论:0 推荐:0
离线云 2020-07-27 19:08 阅读:5293 评论:0 推荐:0
离线云 2019-12-22 02:48 阅读:263 评论:0 推荐:0
离线云 2019-12-18 15:18 阅读:285 评论:0 推荐:0
离线云 2019-08-28 00:16 阅读:3009 评论:1 推荐:0
离线云 2019-08-04 13:37 阅读:204 评论:0 推荐:0
离线云 2019-07-29 14:01 阅读:6414 评论:0 推荐:0
离线云 2019-07-25 17:52 阅读:353 评论:0 推荐:0
上一页 1 ··· 3 4 5 6 7 8 9 下一页