为什么使用<脚本>当存在脚本>
这是我的情况:
我想使用 Google AdWord 的转换脚本,但由于某种原因,其代码片段的 javascript 部分向我的页面添加了一些我似乎无法摆脱的不需要的空白。
因此,我正在查看的选项纯粹是使用加载 1x1 图像的代码片段部分。显然,我会删除标签以使 1x1 图像始终出现在所有浏览器中,并且我将删除其代码片段的一部分。
我的问题是,这样做有缺点吗? Google的转换脚本有javascript和非javascript选项肯定是有原因的。 javascript 选项是否比非 javascript 选项更好?如果它们同样好,那么为什么 Google 不保持简单并为所有浏览器使用非 javascript 方法,无论它们是否有 javascript。
谢谢!
Here's my situation:
I'd like to use Google AdWord's conversion script, but for some reason the javascript part of their snippet adds some undesirable whitespace to my page that I can't seem to get rid of.
So the option I'm looking at is purely using the part of their snippet where the 1x1 image is loaded. Obviously I would take out the tags to make that 1x1 image appear all the time for all browsers, and I'll remove the part of their snippet.
My question is, is there a disadvantage to this? There must be a reason why Google's conversion script has a javascript and non-javascript option. Is the javascript option better somehow than the non-javascript option? If they are equally good, then why didn't Google just keep it simple and use the non-javascript method for all browsers, regardless of whether they have javascript or not.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 AdWords 不是特别熟悉,但一般来说,大多数网站分析工具都有这两个选项,而 JavaScript 选项更好,因为它可以提供有关用户的更多详细信息。
noscript
选项通过加载 1x1 图像,仅在服务器端记录请求,其中包含非常有限的信息,例如您的 IP 地址和浏览器的用户代理字符串。使用 JavaScript 可以为您提供其他信息,例如显示分辨率、引用页面以及是否安装了 Flash/Java 等插件。
I'm not particularly familiar with AdWords, but in general, most website analytics tools have both options, and the JavaScript option is better because it can provide more details about the user.
The
noscript
option, by loading a 1x1 image, simply logs a request on the server-side, and this contains very limited information such as your IP address and your browser's user agent string.Using JavaScript can give you additional information such as display resolution, referring page and whether plug-ins such as Flash/Java are installed.