jQuery Mobile自动添加& nbsp [英] Jquery Mobile automatically adds &nbsp

查看:89
本文介绍了jQuery Mobile自动添加& nbsp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Jquery Mobile获得了以下代码:

i've got this code using Jquery Mobile :

<div role="main" class="ui-content">
  <form action="/" method="post">
    <fieldset data-role="controlgroup">
      <input type="checkbox" name="checkbox-1a" id="checkbox-1a" checked="">
      <label for="checkbox-1a">Cheetos</label>
      <input type="checkbox" name="checkbox-2a" id="checkbox-2a">
      <label for="checkbox-2a">Doritos</label>
      <input type="checkbox" name="checkbox-3a" id="checkbox-3a">
      <label for="checkbox-3a">Fritos</label>
      <input type="checkbox" name="checkbox-4a" id="checkbox-4a">
      <label for="checkbox-4a">Sun Chips</label>
    </fieldset>
   </form>
 </div>

问题是,当我加载页面时,代码看起来像这样:

The problem is that when i load the page the codes looks like this :

<div class="ui-controlgroup-controls ">
&nbsp;&nbsp;&nbsp;&nbsp;
<div class="ui-checkbox">

我跳过了整个代码,问题出在

I've skipped the whole code, the problem is in the

&nbsp;

那不应该在那里. 关于如何解决它的任何想法?

that should not be there. Any idea about how to fix it?

推荐答案

从他们的网站复制和粘贴源代码时会出现此问题.

This problem comes when copying and pasting the source code from their website.

实际上,您还以这种方式复制了浏览器转换为&nbsp; 的不可见空格,并使最后一块下降.

In fact in this way you copy also invisible blank spaces which are converted as &nbsp; by the browser and make the last block go down.

要解决此问题,只需删除标记之间的所有空格,所有空格将正确显示.

To solve the issue simply remove all the spaces between the tags and all will be displayed correctly.

这篇关于jQuery Mobile自动添加&amp; nbsp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆