I'm having a slight problem with my custom JavaScript file playing well in Google Chrome when jquery loads on my Magento site. This issue only appears in Google Chrome. I tested the problem both on Linux Ubuntu 10.10 (chrome 10.0.648.114 beta) and on Windows XP (chrome 9.0.597.98). FF, Safari, IE don't seem to have this problem.
When jQuery is added to JS files for inclusion, my personal JS file does not work when sending a hard update (force 200-request js file). if I do a regular update (request 304 of a js file) and load it from the cache, then it works.
I got to the point of creating a dummy page outside of my magento site, and I still get this problem when I include JS files from the magento site. but, if I move JS files outside of the magento site, does it work fine?
I have disabled caching in my magento admin, and as far as I know, there is no module or custom code / plugins that will affect the JS files that should be included.
Here is an example of my dummy page, which is located in the root directory of my server
The only thing gearlists.js has in it,
alert('external');
so when loading this page I would expect two pop-ups. but on hard refreshment I get only one popup. "Interior".
, JS 304, "", ""
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://VIRTUAL_SERVER_FOR_MAGENTO_SITE/catalog/js/jquery/jquery-1.5.1.js"></script>
<script type="text/javascript" src="http://VIRTUAL_SERVER_FOR_MAGENTO_SITE/catalog/js/ads/gearlists.js"></script>
<script type="text/javascript">
alert('Internal');
</script>
</head>
<body>
</body>
</html>
, JS magento , , .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://localhost/jquery-1.5.1.js"></script>
<script type="text/javascript" src="http://localhost/gearlists.js"></script>
<script type="text/javascript">
alert('here');
</script>
</head>
<body>
</body>
</html>
, jquery , js , , magento VS ... .
, . .