網頁頁面列印選擇的內容
Js指令碼如下:
function preview() {
bdhtml = window.document.body.innerHTML;sprnstr = "<!--startprint-->";
eprnstr = "<!--endprint-->";
prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
window.document.body.innerHTML = prnhtml;
window.print();
}
<!--startprint-->:開始位置標籤,放置在要列印內容開始的位置
<!--endprint-->:結束位置標籤,放置在列印內容結束的位置
相關推薦
網頁頁面列印選擇的內容
Js指令碼如下: function preview() { bdhtml = window.document.body.innerHTML; sprnstr = "<!--startprint-->";
window.print()頁面列印之表格內容分頁填充進行分頁列印
windwow.print()用於列印當前視窗的內容,很簡便,可當內容特殊並且列印有特殊需求的時候就要繞個圈了。下面是需要列印的表格: 當資料量少的時候像上面的表格一樣,中間的內容只有5條資料,打印出來在紙上會有空白,不太好。中間內
CSS3中使用選擇器在頁面中插入內容
1 使用選擇器來插入內容 使用after或before選擇器,在選擇器的content屬性中定義要插入的內容,當插入內容為文字的時候,必須要在插入文字的兩旁加上單引號或者雙引號。 <style type="text/css"> h2:before{ co
使用CSS選擇器在頁面中插入內容
在css中,我們可以使用:before偽元素選擇器與:after偽元素選擇器在頁面的前面和後面以content屬性的方式插入內容。 從css2.0新增這兩個偽元素選擇器到css2.1到現在的3.0,都不斷的在對這兩個選擇器進行改良和擴充套件。 首先,我們來看一下,在c
js列印頁面指定區域內容
2種方式: 一種只支援IE瀏覽器 另一種支援各類瀏覽器 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" c
CSS3之利用選擇器和content屬性在頁面中插入內容
使用選擇器在頁面中插入文字 <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-
使用JavaScript動態刷新頁面局部內容
start mapping ood arch random rand ros servlet asc html頁面: <[email protected]/* */ contentType="text/html; charset=Shift_JIS"%&g
python+selenium+PhantomJS爬取網頁動態加載內容
use for ive comm 自動化測試 mac os x page 影響 blank 一般我們使用python的第三方庫requests及框架scrapy來爬取網上的資源,但是設計javascript渲染的頁面卻不能抓取,此時,我們使用web自動化測試化工具Selen
網頁頁面NULL值對瀏覽器兼容性的影響
vco ise alt trac script input 有時 alua arraylist 網頁頁面NULL值對瀏覽器兼容性的影響
input checkbox 選擇內容輸出多少個
ntb script body nts ner class num click .get <input type="checkbox" name="qId" onclick="doit();"/><input type="checkbox" name="q
HTML頁面禁止選擇、頁面禁止復制、頁面禁止右鍵
HTML頁面禁止選擇 頁面禁止復制 頁面禁止右鍵 HTML頁面內容禁止選擇、復制、右鍵剛在一個看一個站點的源代碼的的時候發現的,其實原來真的很簡單 <body leftmargin=0 topmargin=0 oncontextmenu='return false' ondr
帝國CMS 列表模板頁面 list.var 內容截取
author nbsp 學習 class pan 好的 int 關鍵字 開啟 每天學習一點點 編程PDF電子書免費下載: http://www.shitanlife.com/code list.var 中沒有好的辦法,只能用程序代碼來實現。將整個HTML以一個變量來拼接
網頁取消禁止選擇、復制功能
for 快捷鍵 重新 sele 編輯 操作 notepad++ 禁止 並保存 有些網頁為防止文本被復制,則經常在網頁禁止瀏覽用戶進行選擇、拷貝等操作。如下即為如何取消網頁設定的禁止用戶選擇、復制操作的方法: 1、快捷鍵【Ctrl + S】,將網頁另存為網頁文件(ht
使用JavaScript實現在頁面上所有內容加載完之前一直顯示loading...頁面
back pro webkit index tro ear keyframes nload radius Html 1 <body class="is-loading"> 2 <div class="curtain"> 3 <
簡單的網頁頁面
scala https ima img class nbsp color code head <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta nam
JS實現頁面列印(整體、區域性)
我們在網頁開發過程中經常會有列印頁面的需求,通過JS來實現的方法有很多,這裡我做了一個整理,供大家參考。 方式一:window.print() 整體列印 ?
UI設計教程分享:電商網頁頁面設計常見表現手法
1.手繪插畫 場景、人物以及加上故事的創意繪畫 會給人夢幻若隱若現的感覺,留下深刻的印象,適合做活動頁面以及宣傳自已的品牌 2.簡約 顏色少於三色,背景以明度偏低的顏色為主,在資訊大爆炸的時代,我們
怎麼用Python Flask模板jinja2在網頁上列印顯示16進位制數?
問題:Python列表(或者字典等)資料本身是10進位制,現在需要以16進位制輸出顯示在網頁上 解決: Python Flask框架中 模板jinja2的If 表示式和過濾器 假設我有一個字典index, index['addr']是我要列印在網頁上的元素,本身是字串,需要用int()過濾器將
網頁頁面預載入動畫的實現,載入後隱藏
我們做web app的時候,可以做一個頁面載入廣告,在你網頁載入的時候,先出現一段gif動圖或者是海報。 下面是實現頁面載入動畫的程式碼 首先js程式碼的實現 (function($){ $(window).load(function(){ $('#b
使用.NET Framework中的物件來檢索網頁和處理其內容
實現效果:(擷取其部分) 實現程式碼: $webclient=New-Object System.Net.WebClient $content=$webclient.DownloadString("https://www.cnblogs.com/feiyucha/p/9972094.html")