开发者

JQuery no longer showing up in firefox?

开发者 https://www.devze.com 2023-01-24 05:49 出处:网络
This is going to sound weird. A site that has been around approx 2 yrs without a problem, suddenly the Jquery is not showing up properly.The site uses a jquery calendar, corners, slideshow and lightbo

This is going to sound weird. A site that has been around approx 2 yrs without a problem, suddenly the Jquery is not showing up properly. The site uses a jquery calendar, corners, slideshow and lightbox. This week, they randomly stopped working in Firefox only. The pages show properly in IE (which is amazing in itself), but no-matter what I try they won't work.

I'm not the one who made the site, but it was passed on to me when the person who did left the company. I tried starting with the slideshow, a fres开发者_JAVA百科h re-install of the javascript into the pages, but I can't seem to get it...

It's a pretty big/important website so any help would be VERY appreciated!


I fixed the style issue on the datepicker by moving the other stylesheets from being @import in the core.css to being actual CSS includes in the head so move:

@import url("jquery-ui-1.7.2.custom.css");
@import url("gallery.css");
@import url("lightbox.css");
@import url("thickbox.css")

in core.css to be

<link href="/static/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/static/gallery.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/static/lightbox.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/static/thickbox.css" rel="stylesheet" type="text/css" media="screen" />

where you write out your HEAD contents
I would also separate out your different javascript functions to their own files. LightBox shouldn;'t be chugged in with everything else and it might not be a bad time to upgrade to jQuery 1.4.3


I reviewed the website. The problem is with CSS, not JavaScript. All of your javascript is working fine, even the lightbox.

I'm investigating why the CSS is broken.

Update
You can temporarily fix your problem by changing this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

to this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The problem is most likely your server sending the external css files as text/plain instead of text/css. Firefox expects a certain Content-Type when parsing a strict document.

To be honest, your HTML doesn't even validate as strict XHTML, so I wouldn't bother changing it back unless you intend to validate.


First step is to install the Firebug plugin and check the error messages. A new version of Firefox was released recently, it's possible (but not very likely) there was a change in the latest version that broke some of the jQuery on that site.

0

精彩评论

暂无评论...
验证码 换一张
取 消