<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] ## 前言 本文主要總結了一些線上文檔的實用技術,后面陸續會根據實際需求將不同的技術進行分類或者歸到兼容文檔里。 ## 技術點如下 ### 屏蔽鼠標右鍵 方案:oncontextmenu=”window.event.returnValue=false” ### 取消選取、防止復制 方案:onselectstart=”return false” ### JS不允許粘貼 方案:onpaste=”return false” ### JS防止復制 方案:oncopy=”return false;” oncut=”return false;” ### 可以在收藏夾中顯示出你的圖標 方案:< link rel=”Bookmark” href=”favicon.ico”> ### 關閉輸入法 方案:< input style=”ime-mode:disabled”> ### 防止被人 frame 方案: ~~~ < script > if (top.location != self.location)top.location=self.location; < /script> ~~~ ### 網頁將不能被另存為 方案:< noscript>< iframe src=*.html>< /iframe>< /noscript> ### 查看網頁源代碼 方案:< input type=button value=查看網頁源代碼 onclick=”window.location = “view-source:”+ “http://www.pconline.com.cn””> ### 光標是停在文本框文字的最后 方案: ~~~ < script language=”javascript”> function cc() { var e = event.srcElement; var r =e.createTextRange(); r.moveStart(“character”,e.value.length); r.collapse(true); r.select(); } < /script> < input type=text name=text1 value=”123″ onfocus=”cc()”> ~~~ ### 網頁不會被緩存 方案: ~~~ < META HTTP-EQUIV=”pragma” CONTENT=”no-cache”> < META HTTP-EQUIV=”Cache-Control” CONTENT=”no-cache, must-revalidate”> < META HTTP-EQUIV=”expires” CONTENT=”Wed, 26 Feb 1997 08:21:57 GMT”> 或者< META HTTP-EQUIV=”expires” CONTENT=”0″> ~~~ ### 怎樣去掉圖片鏈接點擊后,圖片周圍的虛線 方案:`< a href=”#” onFocus=”this.blur()”>< img src=”logo.jpg” border=0>< /a>` ### 如何設定打開頁面的大小 方案: ~~~ < body onload=”top.resizeTo(300,200);”> //打開頁面的位置 < body onload=”top.moveBy(300,200);”> ~~~ ### ENTER 鍵可以讓光標移到下一個輸入框 方案:`< input onkeydown=”if(event.keyCode==13)event.keyCode=9″>` ### 各種樣式的光標 方案: auto :標準光標 ;default :標準箭頭 ; hand :手形光標; wait :等待光標; text :I 形光標; vertical-text :水平; I 形光標; no-drop :不可拖動光標 ; not-allowed :無效光標 ; help :?幫助光標 ; all-scroll :三角方向標; move :移動標; crosshair :十字標;其他: e-resize n-resize nw-resize w-resize s-resize se-resize sw-resize ### 在規定時間內跳轉 方案:`< META http-equiv=V=”REFRESH” content=”5;URL=http://www.51js.com”>` ### 將徹底屏蔽鼠標右鍵 方案:oncontextmenu=”window.event.returnValue=false” ### ie與其他瀏覽器的區別 解析:在獲取屬性,ajax請求,事件坐標,透明的寫法,阻止冒泡等均是不同的。 參考資料:[ie與其他瀏覽器區別](http://blog.csdn.net/a464064368/article/details/71436539) ### web應用向前端推送數據的方式 * js * Commet:基于HTTP長連接的服務器推送技術 * 基于WebSocket的推送方案 * SSE(Server-Send Event):服務器推送數據新方式 方案:oncontextmenu=”window.event.returnValue=false” ### 實現文本縮進 方案:text-indent 可以實現文本的縮進 ### 將徹底屏蔽鼠標右鍵 方案:oncontextmenu=”window.event.returnValue=false” ### java根據html代碼生成pdf文件 方案:參考代碼 ~~~ public void createPdf() throws Exception { // step 1 String inputFile = "index.html"; String url = new File(inputFile).toURI().toURL().toString(); String outputFile = "index.pdf"; System.out.println(url); // step 2 OutputStream os = new FileOutputStream(outputFile); org.xhtmlrenderer.pdf.ITextRenderer renderer = new ITextRenderer(); renderer.setDocument(url); // step 3 解決中文支持 org.xhtmlrenderer.pdf.ITextFontResolver fontResolver = renderer .getFontResolver(); fontResolver.addFont("c:/Windows/Fonts/simsun.ttc", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); renderer.layout(); renderer.createPDF(os); os.close(); System.out.println("create pdf done!!"); } ~~~ ### 加載https協議的文件 大家在使用原始方式載入腳本或者樣式文件的時候,一般cdn的建議方式是https的,但我們的應用協議不一定是https的,這種時候使用// ,會自動識別當前頁面適合的協議,如果你強行使用https就會報錯或者很慢 ## 參考文檔 * [值得收藏的js實用技術](http://mp.weixin.qq.com/s/yT3YPpAVCR9RTS1lfQDQCw)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看