什么是某些零售网站上某些美元价值的报价目的? [英] What is the purpose of the quotes around some dollar values on certain retail sites?

查看:82
本文介绍了什么是某些零售网站上某些美元价值的报价目的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在做一些项目的工作时,我偶然发现了一些我无法解释的网站的格式化情况。



在Google上查看标记时Chrome DOM检查器的某些值在其周围显示引号。这些引号不会出现在HTML源代码或呈现的页面中。



格式如下:

 < span class =...> $< / span> 
XX。
< span class =...> xx< / span>

OR

  $ XX。 
< span class =...> xx< / span>

或者两者稍有不同。大X是价格中的美元数量,小X是美分。



这些结构中我不明白的部分是美元价值。为什么他们使用,为什么他们不出现在网站的显示?

这是一个问题与Google Chrome DOM检视器。当一个字符串文字与它周围的标签不在同一行上时,字符串文字将显示在一个新的行上,字符串字面上带有引号,以便在字符串开始和结束的位置显示。



例如,当字符串文字以空格开始,并在检查器内的新行中显示时,您只能看到该字符串是否被引用。否则,您将无法看到字符串的起始位置。



请使用Google Chrome浏览器DOM检查器进行检查:
http://jsfiddle.net/bFcNn/2/



这些引号既不存在也不存在在源代码中,也不在页面加载后的DOM中。它们只在Google Chrome的DOM Inspector中作为结构元素存在。他们在任何时候都不是您正在查看的页面的一部分。


In doing some work on a project I stumbled across a formatting situation on a couple of websites that I couldn't explain.

When viewing the markup in the Google Chrome DOM inspector, some values appear with quotes around them. These quotes do not appear in either the HTML source nor the rendered page.

The format is as follows:

<span class="...">$</span>
"XX."
<span class="...">xx</span>

OR

"$XX."
<span class="...">xx</span>

OR some slight variation of the two. The large X's are the dollar amount in the price and the small x's are the cents.

The part of these structures I don't understand is the quotes around the dollar value. Why are they used and why do they not appear in the display of the website?

解决方案

It is an "issue" with the Google Chrome DOM Inspector. When a String literal is not on the same line with its surrounding tag then the string literal is displayed on a new line with quotes around the string literal to make it visible where the string starts and ends.

For example when the string literal starts with a whitespace and is displayed in a new line inside the inspector then you only can see that if the string is quoted. Otherwise you won't be able to see where the string begins.

Inspect this with Google Chrome DOM Inspector: http://jsfiddle.net/bFcNn/2/

These quotes exist neither in source code nor in the DOM after page has been loaded. They only exist as a structural element inside Google Chrome's DOM Inspector. They are at no time part of the page you're inspecting.

这篇关于什么是某些零售网站上某些美元价值的报价目的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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