开发者

jQuery, Difference between Firefox and Chrome

For example I have this snippet of html code:

    .....
    <span class="no">   1</span> require <span class="s"><span class="dl">'</span><span class="k">yaml</span><span class="dl">'</span></span>
    <span class="no">   2</span> require <span class="s"><span class="dl">'</span><span class="k">set</span><span class="dl">'</span></span>
    <span class="no">   3</span>
    <span class="no">   4</span> <span class="r">module</span> <span class="cl">ActiveRecord</span> <span class="c">#:nodoc:</span>
    <span class="no">   5</span>   <span class="c"># Generic Active Record exception class.</span>
    <span class="no">   6</span>   <span class="r">class</span> <span class="cl">ActiveRecordError</span> &lt; <span class="co">StandardError</span>
    <span class="no">   7</span>   <span class="r">end</span>
    .....

Then I'm running this jQuery code in Firefox and Chrome browsers:

$('.no')[0]

In Chrome I've got:

<span class=​"no">​   1​</span>​

Bu开发者_运维技巧t in Firefox I've got not full element:

<span class="no">

This difference is really makes mess in my project, please explain me why and how to avoid this problem. Thanks


That might be just the way the firebug or chrome debugger displays it. Have you tried doing something like

alert ( $('.no')[0].html() );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜