如何删除不可见的“& nbsp;& nbsp;"已自动添加到代码中 [英] How do I remove invisible "  " which has been automatically added to code

查看:484
本文介绍了如何删除不可见的“& nbsp;& nbsp;"已自动添加到代码中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在JQuery Mobile中开发一个移动网站,并且发现在表面上似乎是随机"的地方,Web浏览器正在添加:

I am developing a mobile website in JQuery Mobile and I am fining that at seemingly 'random' points, the web browser is adding in:

"        "

(出现在不同页面上的金额不同).

(different amounts on the different pages it occurs).

许多代码基础都是直接从JQM演示站点复制并粘贴的,以用于不同的小部件/布局等.我已经读到,从不同位置复制/粘贴代码可能会导致此问题.问题是,如何删除它,尤其是当我已经进行了合理数量的编码时?

Much of the base of the code is copied and pasted straight from the JQM demo site for the different widgets/layouts etc... and I have read that copying/pasting code from different places can cause this issue. The problem is, how do I remove it, especially when I have already done a reasonable amount of coding?

我尝试将其复制/粘贴到记事本中,另存为纯文本文档,然后复制/粘贴回我的编辑器(Sublime text 2),但这似乎不起作用.

I have tried copy/pasting it into notepad, saving as a plain text doc and then copy/pasting back into my editor (Sublime text 2) but that doesn't seem to work.

如果可能的话,我宁愿使用程序解决方案,而不必添加一行脚本以在浏览器端将其删除.

I'd prefer a procedural solution over having to add a line of script to strip it out at the browser end if possible.

可以在此页面上看到一个示例: http://noee.brandallareas.co. uk/#delegates , 表格之间没有太多的空间(您可以通过firebug/element inspector查看添加的空格字符).

An example of this can be seen on this page: http://noee.brandallareas.co.uk/#delegates , There is not meant to be that much space between the tables (you can see the added space characters through firebug/element inspector).

推荐答案

我找到了答案,我在另一个论坛上提问,得到了解决问题的方法.我以为我会在这里发布以供将来参考:

I have found the answer, I asked the question on another forum and got this which has solved the issue. I thought I would post here for future reference:

如果从Web浏览器中的格式化显示中复制而不是使用查看源代码",则文档中现在具有Unicode \ 0xA0字符.使用文本编辑器搜索并删除它们.或者,您可以安装一个突出显示非ASCII字符的插件. (我认为有一个称为"Unicode荧光笔"的标记-可能还有其他标记.)

If you copied from the formatted display in your web browser, rather than using "view source", you now have Unicode \0xA0 characters in your document. Use your text editor to search and remove them. Alternately, you can install a plugin that will highlight non-ASCII characters. (I think there is one called "Unicode Highlighter" - there may be others.)

(发布者-watusiware)

(Posted by - watusiware)

原始论坛主题为 查看全文

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