调试没有错误或警告

时间:2011-04-27 08:02:18

标签: jquery debugging safari flickr

我正在制作一个在Chrome和Firefox中运行完美的网站。但在Safari中它不起作用。但是我的控制台中没有错误或警告。我从哪里开始?

在Safari 5.0.5(mac)和IE9中不起作用。

我认为问题出在从Flickr加载的脚本中。

http://aalborguni.jonasjonasjonas.dk/arkiktektonisk-mestervaerk/ - 如果你有时间,请检查一下:)

4 个答案:

答案 0 :(得分:2)

究竟什么不起作用?这是Mac还是Win? Safari版本?更多信息将有助于解决问题。

从理论上讲,Chrome和Safari都是基于Webkit的浏览器(尽管版本略有不同)并且应该在操作上非常相似,尽管Chrome使用的是V8 JS引擎而Safari却没有。

我首先使用Safari JS调试器并逐步执行代码并查询变量等,看看是否有任何事情发生在你身上。

在这个问题中显示了关于两者之间差异的更多信息:

Does Google Chrome display pages the same as Safari?

关于不同JS引擎的更多信息:

JavaScript Engines

答案 1 :(得分:1)

我用winSafari调试它并获取

Unmatched </p> encountered.  Converting </p> into <p></p>. line 115 ---p>

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&#8217;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<p>&nbsp;</p>
</p> <-- ERROR
             </div>
         </div>   

我不知道是不是这个..因为javascript没有加载。但也许?! # 我不认为这是

- 但无论如何都要解决 - 你的STYLING有问题吗?!

当页面加载

<div id="featured" class="orbit" style="height: 1px; width: 1px;

图像在那里并加载但由于某种原因它没有造型。所以再次..插件工作正常 - 0尝试删除除了jquery和oribit之外的所有东西 - 或者尝试在safari中单独测试一个测试页。

Safari

因此脚本过早结束,因为没有发生骑行。

答案 2 :(得分:0)

“子弹:真实”之后的逗号对我来说似乎不对。

$(window).load(function() {
    $('#featured').orbit({
     animation: 'horizontal-push',      // fade, horizontal-slide, vertical-slide, horizontal-push
     timer: true,            // true or false to have the timer
     advanceSpeed: 8000,         // if timer is enabled, time between transitions 
     pauseOnHover: true,
     startClockOnMouseOut: true,     // if clock should start on MouseOut
     bullets: true,      // true or false to activate the bullet navigation
    });

答案 3 :(得分:0)

我找到了这个愚蠢错误的答案。

问题是在flickr脚本之前初始化了轨道脚本。因此无法确定图像的宽度/高度。

在这种情况下,我通过将高度/宽度硬编码到flickr-loader中找到了一个简单的解决方案 - 并且一旦完成就初始化Orbit。

感谢您的帮助!