Scriptaculous, sIFR and basically JS includes issues
Zen-Cart 1.3.7.1 (current as of now)
PHP 4.3.11 MySQL 4.1.22
Linux Apache server with Godaddy :ohmy:
Location: http://dev.michele-co.com
Custom theme with all the overrides
I think the problems are related so I think I can roll them into one ball of wax.
I uploaded my JS files to my template jscript folder and renamed them jscript_name. I see that they do get loaded in the HEAD as they should.
But with both Scriptaculous and sIFR they work in conjunction with other files. I have aimlessly tried these files in different places and really don't know if they are found or how to test (other than I never get them to work). Is Zen-Cart doing something here? It would make sense to me that the ZC environment could be throwing something off.
For instance I have JS in an href:
Code:
<a href="javascript:new Effect.toggle('contact', 'SlideDown');">
I'm not real handy in JS, but as far as I can tell that should work.
Scriptaculous uses other files for its libraries... I am unsure if they need the same treatment as the primary script files (to be loaded in the HEAD, a thing I doubt) or uploaded as-is to the jscript folder or somewhere else. I really don't know what the point of reference is for paths called from the scripts.
I'm also unsure if my SWF file for sIFR is ever found, even when I use a full path. Bottom line is nothing seems to want to work, yet I have used them successfully in other web programs.
I know people get skiddish when there is 3rd party code involved, but both Scriptaculous and sIFR are very widely used and there are minimal alternatives. I think it would be healthy for ZC to document their use (something I would do myself if I could figure this out).
Re: Scriptaculous, sIFR and basically JS includes issues
If you need your .js files to load on every page, then put them in your template's jscript folder, named jscript_*.js
Then in your HTML, use the calls to the js functions as needed. The a href you quoted appears to be reasonably appropriate.
If you need to access swf files, you'll have to insert the appropriate HTML to load the swf file. Note that the path you specify to find the swf file will be relative to your Zen Cart store "root" ... ie: relative to the same folder where your index.php file is located. So, if you put your .swf file in the images folder, then you could call your swf file via "images/myfile.swf" etc.