jQuery:$(模板)vs .clone()(jQuery: $(template) vs .clone())
假设我们有一个复杂的字符串
template
(也许是一个包含大量其他标签的div),我们需要多次将这个HTML节点添加到我们现有的文档中。每次从模板创建HTML节点会更快吗?
var $html = $(template); // 1st run var $html = $(template); // 2st run ...
或者只创建一次然后克隆它们:
var $template = $(template); // init var $html = $template.clone() // 1st run var $html = $template.clone() // 2st run ...
Lets say we have a complex string
template
(maybe a div containing lots of other tags..) and we need to add this HTML node multiple times to our existing document.Will it be faster to create the HTML nodes from the template each time
var $html = $(template); // 1st run var $html = $(template); // 2st run ...
or to only create them once and then clone them:
var $template = $(template); // init var $html = $template.clone() // 1st run var $html = $template.clone() // 2st run ...
原文:https://stackoverflow.com/questions/12989392
更新时间:2024-03-27 17:03
最满意答案
这可能是这个问题 。 你可以尝试以下
在终端的terminfo / termcap中设置
kbs=\177
:infocmp $TERM | sed 's/kbs=^[hH]/kbs=\\177/' > $TERM.ti tic $TERM.ti
相关问答
更多-
无法映射
,并且不确定原因(Cannot map [2023-01-19], and not sure why) 这可能是这个问题 。 你可以尝试以下 在终端的terminfo / termcap中设置kbs=\177 : infocmp $TERM | sed 's/kbs=^[hH]/kbs=\\177/' > $TERM.ti tic $TERM.ti 资源 It is probably this issue. You can try following Set kbs=\177 in your terminal's terminfo/termcap: infocmp $TERM | sed 's/kbs=^[ ... -
如何使describe-function“Ch f”默认情况下不区分大小写(How to make describe-function “C-h f” case-insensitive by default)[2022-08-10]
(setq completion-ignore-case t)应该做你想要的,全局而不仅仅是Ch f 。 (setq completion-ignore-case t) should do what you want, tho globally rather than only for C-h f. -
如何在Emacs中以编程方式查找在哪个映射中键绑定(How to find in which map a key binding is from programmatically in Emacs)[2023-06-25]
以下是可以适应您的需求的代码: (defun bunch-of-keybindings (key) (list (minor-mode-key-binding key) (local-key-binding key) (global-key-binding key))) 示例输入: (bunch-of-keybindings (kbd "C-c @ C-c")) 输出: (((hs-minor-mode . hs-toggle-hiding)) 1 2) 数字表示在本地和全球地图 ... -
类型? 你会得到一个缓冲区显示: Type SPC or `y' to save the current buffer; DEL or `n' to skip the current buffer; RET or `q' to give up on the save (skip all remaining buffers); C-g to quit (cancel the whole command); ! to save all remaining buffers; C-r to view this bu ...
-
Emacs Ch c似乎不适用于和弦3组合长?(Emacs C-h c doesn't seem to work for chords 3 combinations long?)[2023-06-12]
对于三个键长的组合来说,这不是一般问题:例如,Ch c ESC ESC ESC(keyboard-escape-quit)或Ch c Cx rt(string-rectangle)都可以正常工作。 当我在组织模式下尝试Ch c Cu Cc Cq时,命令在Cu之后中断并显示: C-u runs the command universal-argument 在迷你缓冲区,这是正确的。 所以,事实上,“Cu Cc Cq”不是一个命令,它是命令“Cc Cq”(org-table-wrap-region)以另一个参 ... -
Cu为它之后调用的函数提供了一个前缀参数(正如你可以从它的文档中看到的那样)。 访问M-.的文档M-. 然后查看函数收到前缀参数时会发生什么。 Cu M-.没有单独的文档Cu M-. 因为它不是单独的功能。 C-u is provides a prefix argument to the function called after it (as you can see from its docs). Access the documentation for M-. and then look there f ...
-
检查Terminal.app Preferences中使用的设置的“ Advanced选项卡。 Terminal -> Preferences-> Settings -> [settings name] -> Advanced 并确保取消选中Delete sends Ctrl-H设置。 编辑:对不起,我误解了你的问题。 对于在Terminal.app下使用/usr/bin/emacs遇到问题的人,这个答案可能会有所帮助,这是您没有的问题。 Found the solution here: http://w ...
-
octave.el似乎在三个不同的键盘图中设置了这些绑定: octave-mode-map inferior-octave-mode-map octave-help-mode-map 您还可以参考Emacs中的全局覆盖键绑定 octave.el appears to set those bindings in three different keymaps: octave-mode-map inferior-octave-mode-map octave-help-mode-map You might als ...
-
如何重新绑定通常绑定到Ch和
的Emacs帮助键?(How do I rebind the Emacs help key normally bound to C-h and [2024-01-02]?) (global-set-key "\C-ch" help-map) (global-set-key "\C-ch" help-map) -
:help :command 显示:command的文档。 :help i_ctrl-a 显示插入模式下
的文档。 如何使用文档是新的vimmer应该学习的最重要的事情 。 认真。 如果您遇到棘手的映射问题,请说 b ,您可以这样做 :verbose map b 知道它的作用以及它的定义。 :help :command shows the documentation for :command. :help i_ctrl-a shows the documenta ...