久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='SDiox'></tfoot>

      <bdo id='SDiox'></bdo><ul id='SDiox'></ul>

    <i id='SDiox'><tr id='SDiox'><dt id='SDiox'><q id='SDiox'><span id='SDiox'><b id='SDiox'><form id='SDiox'><ins id='SDiox'></ins><ul id='SDiox'></ul><sub id='SDiox'></sub></form><legend id='SDiox'></legend><bdo id='SDiox'><pre id='SDiox'><center id='SDiox'></center></pre></bdo></b><th id='SDiox'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SDiox'><tfoot id='SDiox'></tfoot><dl id='SDiox'><fieldset id='SDiox'></fieldset></dl></div>

        <small id='SDiox'></small><noframes id='SDiox'>

      1. <legend id='SDiox'><style id='SDiox'><dir id='SDiox'><q id='SDiox'></q></dir></style></legend>

        我什么時候應該使用 javascript 框架庫?

        When should I use a javascript framework library?(我什么時候應該使用 javascript 框架庫?)
      2. <tfoot id='fuX9Z'></tfoot>
          <tbody id='fuX9Z'></tbody>

          <legend id='fuX9Z'><style id='fuX9Z'><dir id='fuX9Z'><q id='fuX9Z'></q></dir></style></legend>
          <i id='fuX9Z'><tr id='fuX9Z'><dt id='fuX9Z'><q id='fuX9Z'><span id='fuX9Z'><b id='fuX9Z'><form id='fuX9Z'><ins id='fuX9Z'></ins><ul id='fuX9Z'></ul><sub id='fuX9Z'></sub></form><legend id='fuX9Z'></legend><bdo id='fuX9Z'><pre id='fuX9Z'><center id='fuX9Z'></center></pre></bdo></b><th id='fuX9Z'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fuX9Z'><tfoot id='fuX9Z'></tfoot><dl id='fuX9Z'><fieldset id='fuX9Z'></fieldset></dl></div>

          <small id='fuX9Z'></small><noframes id='fuX9Z'>

                <bdo id='fuX9Z'></bdo><ul id='fuX9Z'></ul>

                  本文介紹了我什么時候應該使用 javascript 框架庫?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在編寫一個小型網站,它只是制作一些動畫并將一些信息顯示為主頁和鏈接列表.所有這些都將在客戶端動態生成.所以一切都將是 javascript 和 XML.

                  最近我一直在閱讀 SO 中有關 javascript 的一些問題,并且大多數情況涉及框架的使用和/或推薦(jquery 和朋友).小型 Web 開發何時應該開始考慮使用這樣的框架?

                  到目前為止,我一直只使用普通的 javascript 來做我的事情,就我沒有實現大型網站而言,是否值得學習一個框架?

                  謝謝

                  解決方案

                  在 SO 上你會發現 很多 人(包括我)提倡使用 jQuery(尤其是).對我來說,這是一個框架應該具備的一切:小型、輕量級、可擴展、緊湊但功能強大且語法簡潔,它解決了一些非常重要的問題.老實說,我很難想象一個我不會使用它(或其他框架)的項目.

                  使用它的原因是為了解決瀏覽器的兼容性問題.考慮我對 javascript 獲取段落的回答網頁中所選文本的數量:

                  <塊引用>

                  函數 getSelectedParagraphText() {var 用戶選擇;如果(window.getSelection){選擇 = window.getSelection();} else if (document.selection) {選擇 = document.selection.createRange();}var parent = selection.anchorNode;while (parent != null && parent.localName != "P") {父 = 父節點;}如果(父母==空){返回 "";} 別的 {返回 parent.innerText ||父.文本內容;}}

                  如果您熟悉 Javascript,那么您應該熟悉其中的很多內容:檢查 innerText 或 textContent (Firefox 1.5) 等等.純 Javascript 充斥著這樣的東西.現在考慮 jQuery 解決方案:

                  函數 getSelectedParagraphText() {var 用戶選擇;如果(window.getSelection){選擇 = window.getSelection();} else if (document.selection) {選擇 = document.selection.createRange();}var parent = selection.anchorNode;var paras = $(parent).parents("p")返回 paras.length == 0 ?"" : paras.text();}

                  jQuery 真正閃耀的地方在于 AJAX.周圍有 JavaScript 代碼片段來找到正確的對象來實例化(XMLHttpRequest 或等效的)來執行 AJAX 請求.jQuery 會為您處理所有這些.

                  對于核心 jQuery Javascript 文件,所有這些都在 20k 以下.對我來說,這是必須的.

                  I'm writing a small web that just makes some animation and shows some information as a homepage and a list of links. All that is going to be generated dynamically in the client side. So everything is going to be javascript and XML.

                  Recently I've been reading some questions in SO about javascript, and most of the situations involved the use and/or recommendation of a framework (jquery and friends). When a small web development should start considering the use of such a framework?

                  I've been until now doing my stuff just with plain javascript, as far as I'm not implementing a big site is it worth the learning a framework?

                  Thanks

                  解決方案

                  On SO you will find a lot of people (including me) who advocate the use of jQuery (in particular). To me, it's everything a framework should be: small, lightweight, extensible, compact yet powerful and brief syntax and it solves some pretty major problems. I would honestly have a hard time trying to envision a project where I wouldn't use it (or another framework).

                  The reason to use it is to solve browser compatibility issues. Consider my answer to javascript to get paragraph of selected text in web page:

                  function getSelectedParagraphText() {
                    var userSelection;
                    if (window.getSelection) {
                        selection = window.getSelection();
                    } else if (document.selection) {
                        selection = document.selection.createRange();
                    }
                    var parent = selection.anchorNode;
                    while (parent != null && parent.localName != "P") {
                      parent = parent.parentNode;
                    }
                    if (parent == null) {
                      return "";
                    } else {
                      return parent.innerText || parent.textContent;
                    }
                  }
                  

                  If you're familiar with Javascript a lot of this should be familiar to you: things like the check for innerText or textContent (Firefox 1.5) and so on. Pure Javascript is littered with things like this. Now consider the jQuery solution:

                  function getSelectedParagraphText() {
                    var userSelection;
                    if (window.getSelection) {
                        selection = window.getSelection();
                    } else if (document.selection) {
                        selection = document.selection.createRange();
                    }
                    var parent = selection.anchorNode;
                    var paras = $(parent).parents("p")
                    return paras.length == 0 ? "" : paras.text();
                  }
                  

                  Where jQuery really shines though is with AJAX. There JavaScript code snippets around to find the correct object to instantiate (XMLHttpRequest or equivalent) to do an AJAX request. jQuery takes care of all that for you.

                  All of this for under 20k for the core jQuery Javascript file. To me, it's a must-have.

                  這篇關于我什么時候應該使用 javascript 框架庫?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                1. <tfoot id='6sJed'></tfoot>

                  <small id='6sJed'></small><noframes id='6sJed'>

                  <legend id='6sJed'><style id='6sJed'><dir id='6sJed'><q id='6sJed'></q></dir></style></legend>

                    <tbody id='6sJed'></tbody>
                  <i id='6sJed'><tr id='6sJed'><dt id='6sJed'><q id='6sJed'><span id='6sJed'><b id='6sJed'><form id='6sJed'><ins id='6sJed'></ins><ul id='6sJed'></ul><sub id='6sJed'></sub></form><legend id='6sJed'></legend><bdo id='6sJed'><pre id='6sJed'><center id='6sJed'></center></pre></bdo></b><th id='6sJed'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6sJed'><tfoot id='6sJed'></tfoot><dl id='6sJed'><fieldset id='6sJed'></fieldset></dl></div>
                    <bdo id='6sJed'></bdo><ul id='6sJed'></ul>

                            主站蜘蛛池模板: 颜色网站在线观看 | 国产精品污www一区二区三区 | 国外成人在线视频 | 久久久久久www | 神马福利 | 国产一区二区久久 | 在线日韩中文字幕 | 亚洲传媒在线 | 一级片在线播放 | 久久九 | 国产精品久久国产精品 | 国产精品电影网 | 一区二区在线不卡 | 精品国产乱码久久久久久蜜臀 | 免费看片在线播放 | 亚洲免费精品 | 色欧美片视频在线观看 | 在线视频中文字幕 | 日韩一区二区三区四区五区六区 | 龙珠z国语版在线观看 | 91超碰在线| 亚洲精品大片 | 亚洲一区三区在线观看 | 成人免费一区二区三区视频网站 | 亚洲电影在线播放 | 色婷婷久久久亚洲一区二区三区 | 99免费精品 | 噜久寡妇噜噜久久寡妇 | 精品伦精品一区二区三区视频 | 成人精品国产免费网站 | 精品国产区 | 一区二区高清不卡 | 亚洲天堂中文字幕 | 精品国产一区二区三区久久久久久 | 国产日韩精品久久 | 亚洲精品视频在线看 | 韩日在线观看视频 | 国内久久 | 99tv成人影院| 国产精品久久久久久久免费大片 | 日本午夜在线视频 |