开发者

Jquery doesn't load in firefox and internet explorer

I have a website hosted and when I open it on google chrome all work ok, but in firefox and internet explorer javascript doesn't loads.

This is the code:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Me gustas cuando callas | ...es nombre de BLOG</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="es" />
    <meta name="description" content="Me gustas cuando callas es un proyecto nacido de la ilusión común de un grupo de personas de distintas edades, sexos y lugares del mundo, personas diferentes  a quienes la casualidad o tal vez el destino reunió en un mismo lugar." />
    <meta name="author" content="gresking@gmail.com" />
    <meta name="keywords" content="me, gusta, cuando, callas" />
    <meta name="robots" content="all" />
    <link href="css/reset.css" rel="stylesheet" type="text/css"/>
    <link href="css/layout.css" rel="stylesheet" type="text/css"/>
    <link href="css/ui/jquery.css" rel="stylesheet" type="text/css"/>
    <link rel="shortcut icon" type="image/x-icon" href="css/img/favicon.ico" />
    <script language="javascript" type="text/javascript" src="js/jquery.js"开发者_C百科></script>
    <script language="javascript" type="text/javascript" src="js/cufon.js"></script>
    <script language="javascript" type="text/javascript" src="js/fonts/caviardreams.js"></script>
    <script language="javascript" type="text/javascript" src="js/plugins.js"></script>
    <script language="javascript" type="text/javascript" src="js/main.js"></script>
</head>
<body>CONTENT</body></html>

And I have realised that it must be jquery, cos I include an alert("test"); and it works but all inside $(document).ready(function(){...}); doesn't.

Help PLS! :(


Do you see the jquery js file if you type this in FF or IE?

http://<yoursite_URL>/js/jquery.js

Try with this as well:

<script language="javascript" type="text/javascript" src="/js/jquery.js"></script>

You can also try with external jquery library to see if it makes any differences:

This might be a better option unless you have custom code inside jquery :)

<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js" type="text/javascript"></script>


If you load your page in Firefox (I Googled it) with firebug enabled then you get an error in the file js/plugins.js:

flashver.split is not a function

I'm not sure what that line of code is doing, but flashVer is set to -1 at the beginning, and I guess it is meant to be set to a string but isn't for some reason.


A couple of possibilities:

1) The code is wrapped in a document.ready. Is the page ever completely finished loading?

Perhaps there is a broken image, timing-out api call, or some other resource that is causing the page to not be fully loaded in one browser, while in other browsers it cuts off the calls at a certain amount of time. Edit

I checked the developer console of chrome, and a few images are not loading

ui-bg_highlight-soft_100_f6f6f6_1x100.png Failed to load resource: the server responded with a status of 404 (Not Found)

I bet other browsers are not triggering ready because of this.

2) Sometimes browsers interpret and fix url problems like the following:

/js/jsfile.js
http://www.mysite.com//js/jsfile.js

or

js/jsfile.js
http://www.mysite.comjs/jsfile.js

when those are included as relative link addresses. Perhaps there is a url error and one browser fixes it for you, and the other interprets it correctly?

3) Another possibility could be that one of your other js files conflicts with jQuery and jQuery goes into no-conflict mode causing $() not to work, but instead using jQuery()


it was because I used a reserved name "var class"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜