Forums / Templates, Stylesheets, Page Layout / implementing javascript across the site

implementing javascript across the site

Locked
Results 1 to 7 of 7
This thread is locked. New replies are disabled.
22 Mar 2010, 02:47
#1
xrich avatar

xrich

New Zenner

Join Date:
Mar 2010
Posts:
3
Plugin Contributions:
0

implementing javascript across the site

I have designed a java script document that utilises .css to replace native elements cross browser platform an want to implement it into the site for form elements only...

I will be willing to share the script if anyone can come up with the answer as to where i would put my 'usual' head links

i.e

<link rel="stylesheet" href="forms.css" type="text/css" media="all" />
<script type="text/javascript" src="jquery.js" ></script>

i will share the code if you require it if an answer can be found! :smile:
22 Mar 2010, 02:59
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: implementing javascript across the site

There's lotsa documentation in the /docs/ folder of your Zen Cart files -- yes, the zip you downloaded.
It's also located in the FAQs/Tutorials area.
And there's also the wiki ...
http://www.zen-cart.com/wiki/index.php/Customisation_-_Templates_-_Stylesheets
http://www.zen-cart.com/wiki/index.php/Customisation_-_Templates_-_Javascript
22 Mar 2010, 03:08
#3
xrich avatar

xrich

New Zenner

Join Date:
Mar 2010
Posts:
3
Plugin Contributions:
0

Re: implementing javascript across the site

I have put my files into the relevant folders

a_template_folder/css/stylesheet.css

common/jscript/on_load/jquery.js

common/jscript/on_load/my.custom.form.js

and no results yet, I have read the documents and I'm still playing around for a few more hours I'll post back if i get results and share
my results, thanks for replying :smile:
22 Mar 2010, 03:16
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: implementing javascript across the site

As per the documents I mentioned, you'll need to rename your jquery.js file as jscript_something.js and your onload script to onload_something.js, and both need to be put into the proper foldernames. You've gotta follow the naming convention for it to work as described.
22 Mar 2010, 03:19
#5
xrich avatar

xrich

New Zenner

Join Date:
Mar 2010
Posts:
3
Plugin Contributions:
0

Re: implementing javascript across the site

yes I understood from the outset as with many systems like this, a structured naming convention is used but thanks al the same :smile:
22 Mar 2010, 12:14
#6
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: implementing javascript across the site

You can load scripts in the html_header. just like you would do in any html template. Reference to the location in this file using the standard html link for css or jscript.
22 Mar 2010, 16:32
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: implementing javascript across the site

CoolCarPartsOnline:

You can load scripts in the html_header. just like you would do in any html template. Reference to the location in this file using the standard html link for css or jscript.

... and it's only necessary to do that if you have very special requirements that won't work by simply putting the required files into the prescribed folders as discussed above.
The idea behind making the folders and naming conventions available as automatic loads was to prevent you having to touch any template files when simply wanting to add javascript handling onto the page.