问题
This page: http://www.ipjnet.talktalk.net/code/photos.html works in Opera11,Chrome, Firefox3 & IE8 locally.
The same page hosted only loads correctly in IE8 & Chrome
I'm new to galleria and jquery so please be gentle with me as I think I must be missing something very obvious.
Thank You very much
回答1:
The slashes in your script files are the wrong ones...
<script src="galleria\src\jquery-1.4.4.js"></script>
<script src="galleria\src\galleria.js"></script>
should be:
<script src="galleria/src/jquery-1.4.4.js"></script>
<script src="galleria/src/galleria.js"></script>
IE on the "local" machine, (and hosted in Quirks mode) let you get away with this. However on the "Web" the path delimiters are forward slashes only.
As a result of the wrong slashes, jQuery and the Galleria don't load at all in Firefox/(other browsers)
回答2:
<script src="galleria\src\jquery-1.4.4.js"></script>
<script src="galleria\src\galleria.js"></script>
should be (forward slash, not back slash)
<script src="galleria/src/jquery-1.4.4.js"></script>
<script src="galleria/src/galleria.js"></script>
surprising it works in chrome...
回答3:
The javascript is not being sourced.
I'm guessing firefox doesn't like the backslashes, try forward slashes.
<script src="galleria/src/jquery-1.4.4.js"></script>
<script src="galleria/src/galleria.js"></script>
来源:https://stackoverflow.com/questions/4820234/galleria-works-locally-in-all-browsers-but-only-ie8-chrome-when-hosted