| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Combining JS, CSS and background images | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Ok, I already know how to do the background image sprites, but I am less sure about the javascript.
Can you really just put all of your javascript in one big file and call just one script? Will this cause any conflicts? Also, with all of the CSS conditional statements, is there really a way to combine all CSS into one file?
__________________
xcart 5.1.2 |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() I could maybe help a little here Ash.
As for java, All my added JS I include in one file and call it js_all.tpl I put it in a folder, then use an include in home.tpl this way it calls it all up from there, so far works a treat, but this is only for my added JS for my tabs, accordions, and other mainly JQuerry js I have not tried us of yet to do what you are saying. Give it a go on a test site and see how it works. As to css, If you can get your head around sorting it all out (Maybe) I think the IE css fixes compatibilities would have to be kept different
__________________
Thank You - Alan Don't be like me, and keep saying "Nearly did it" go do it!! Version: 4.4.4 Gold - |
|||||||||
#3
|
|||||||
|
|||||||
![]() If you have a lot of javascript variables, make sure none conflict (as in assigning variables with the same name in 2 different scripts).
Other than that, yes, you can combine and even minify them to save space. Regarding CSS, yes, you can combine CSS into all one stylesheet, however, whether it's possible with X-Cart, no idea.
__________________
X-Cart Pro 4.2.2 |
|||||||
#4
|
|||||||
|
|||||||
![]() Don't call it as a .tpl or it will actually include the code in the source, thus pushing your content too far down the page (not friendly for SEO). Call it as a .js file, and not with Smarty, but with a <script> link.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||||
|
|||||||||
![]() ok cool... thanks a bunch!!
What about all the CSS?
__________________
xcart 5.1.2 |
|||||||||
#6
|
|||||||
|
|||||||
![]() Embed the condensed CSS file like you would do normally for stylesheets. Depending on which files call it, edit those tpl files to call just 1 CSS file. If the header is constant on all your pages, then your life is made easy and you can just edit that header file to call the single CSS file.
__________________
X-Cart Pro 4.2.2 |
|||||||
#7
|
|||||||||
|
|||||||||
![]() Quote:
Sorry to step over you topic Ash: It only has estension .tpl all the rest of code within it, is links to js files, so I have this included within home.tpl as it creats no clashes > {include file="abeez_sources/templates/jquerry_all.tpl"} so > jquerry_all.tpl has stuff like following > Code:
Doing it other ways gave me some conflicts, this solution works for calling yes, but you are saying call the file estension .js or something? For SEO Purposes?
__________________
Thank You - Alan Don't be like me, and keep saying "Nearly did it" go do it!! Version: 4.4.4 Gold - |
|||||||||
#8
|
|||||||||
|
|||||||||
![]() But that doesn't solve the issue of multiple HTTP requests.
Ash
__________________
xcart 5.1.2 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|