Magento Forum

If Speedster is enabled, inline js does not work. 
 
Italo André
Jr. Member
 
Total Posts:  4
Joined:  2010-09-19
 

I installed Speedster following the instructions. If I check the code-source of the page, I see it is working properly when calling the css and the js inside the html head. But some of my inline javascript (most of them - or maybe all) just breaks. The firebug’s console show some errors that I can’t see a reason to be happening, like: VarienForm is not defined.

The errors are this:

element.attachEvent is not a function
Translate is not a constructor
VarienForm is not defined
element.dispatchEvent is not a function

The result of the troubleshooting posted by Fooman is:

1) HTTP/1.0 404 Not Found

2) I see a little css. 5 lines of code.

3) Same as step 2.

4) I see minified css and js. Though, there is more than one call, is it normal? Code follows below.

<link type="text/css" rel="stylesheet" href="http://127.0.0.1/mage_neosolar/skin/m/1308332703/skin/frontend/default/neosolar/css/jquery.fancybox-1.3.4.css,/skin/frontend/default/neosolar/css/styles.css,/skin/frontend/base/default/css/widgets.css,/skin/frontend/default/neosolar/css/style.css,/skin/frontend/base/default/css/feedreader.css,/skin/frontend/default/neosolar/css/skin.css,/skin/frontend/base/default/css/extended.css,/skin/frontend/default/neosolar/css/slider.css" media="all" />
<
script type="text/javascript" src="http://127.0.0.1/mage_neosolar/skin/m/1310067743/js/lib/jquery.min.js,/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js,/js/scriptaculous/builder.js,/js/scriptaculous/effects.js,/js/scriptaculous/dragdrop.js,/js/scriptaculous/controls.js,/js/scriptaculous/slider.js,/js/varien/js.js,/js/varien/form.js,/js/varien/menu.js,/js/mage/translate.js,/js/mage/cookies.js,/js/lib/simple_thumbs.js,/js/lib/jquery.fancybox-1.3.4.js" ></script>

<script type="text/javascript" src="http://127.0.0.1/mage_neosolar/skin/m/1310067743/js/noix/cadastro_usuario.js,/skin/frontend/default/neosolar/js/jquery-1.3.2.min.js,/skin/frontend/default/neosolar/js/cycle-fade-effect.js,/skin/frontend/default/neosolar/js/slider.js" ></script>
<link type="text/css" rel="stylesheet" href="http://127.0.0.1/mage_neosolar/skin/m/1308080069/skin/frontend/default/neosolar/css/print.css" media="print" />

Can someone help me out with this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kingsy1985
Jr. Member
 
Total Posts:  11
Joined:  2008-11-24
 

I am experiencing a very similar issue, so this is really just a bump to maybe get this thread moving.

All minified js/css files included in the head by m.php are working and contain the code but still I seem to get errors such as \"Varien is undefined\” \"Translate is undefined\” etc etc.

Obviously turning the module off fixes the errors.

Can anyone offer some advice on this problem? I fear by the age of this post this issue has been forgotten.

I am using magento v1.4.1.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kingsy1985
Jr. Member
 
Total Posts:  11
Joined:  2008-11-24
 

Update:
I managed to fix my problem, it was some invalid javascript that was being included in the first of my three minified files. This meant that it wasnt loading the rest of the objects.
My advice to anyone with something similar to this would be to look for any syntax errors and ignore the undefined object errors.
Anyone can give me a shout if they need some help with this.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top