亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

把html頁(yè)面的部分內(nèi)容保存成新的html文件的jquery代碼

 更新時(shí)間:2009年11月12日 21:40:29   作者:  
把html頁(yè)面的部分內(nèi)容保存成新的html文件,用到了jquery的獲取指定id的內(nèi)容。然后保存代碼。
復(fù)制代碼 代碼如下:

//保存聊天記錄到本地
function save_record()
{
//取得當(dāng)前日期作為文件名
var time=new Date();
var filename=time.toLocaleDateString();
//獲取當(dāng)前頁(yè)面部分內(nèi)容
var record=$("#contentList").html();
//打開(kāi)新窗口保存
var winRecord=window.open('about:blank','_blank','top=500');
winRecord.document.open("text/html","utf-8");
winRecord.document.write("<html><style>body,ul,li{margin:0px; padding:0px;list-style:none; font-size:12px;}</style><body>"+record+"</body></html>");
winRecord.document.execCommand("SaveAs", true, filename+".html");
winRecord.close();
}

相關(guān)文章

最新評(píng)論