GaisaMeritajs Posted September 24, 2010 Share Posted September 24, 2010 Hi,Currently Prestashop links to the jQuery code via: /js/jquery/jquery-1.2.6.pack.jsHowever, I would like to link to jQuery from Google's hosted API library. I looked through the header.php file and I don't understand where I should make the changes.Like for example to: http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js(I can't find the packed version of it?)How do I do link to this for all pages on my site?Thanks! Link to comment Share on other sites More sharing options...
Truemedia Posted September 24, 2010 Share Posted September 24, 2010 I wouldn't recommend using the google hosted one, unless you have a copy of jquery on your own server as a backup. Google is known to be blocked in some countries, and the server can sometimes contain a version which may have bugs.Consider adding a condition if you do change it. I think the file is included from a core tpl somewhere in the templates folder. Link to comment Share on other sites More sharing options...
GaisaMeritajs Posted September 24, 2010 Author Share Posted September 24, 2010 I wouldn't recommend using the google hosted one, unless you have a copy of jquery on your own server as a backup. Google is known to be blocked in some countries, and the server can sometimes contain a version which may have bugs.Consider adding a condition if you do change it. I think the file is included from a core tpl somewhere in the templates folder. Thanks for your reply OK, so what about using another API? Like Microsoft?I would be linking directly to a certain version of jQuery - so the bugs shouldn't be a problem.What condition do you mean? Link to comment Share on other sites More sharing options...
Truemedia Posted September 24, 2010 Share Posted September 24, 2010 Microsoft is probably less likely to be blocked than microsoft (I could be wrong so don't take my word on that), but what I mean by a condition is a conditional include statement.So instead of including a [removed][removed] in the tpl of main header, making an if statement to check if the file has been included from google and if not use local javascript, something like: [removed][removed] {!if($) /* jquery global variable doesn't exist */ [removed][removed] } EDIT: My html tags are replaced with removed for some reason :ohh:, dunno where it says removed I put basic html for linking a javascript file. Link to comment Share on other sites More sharing options...
GaisaMeritajs Posted September 24, 2010 Author Share Posted September 24, 2010 The forum probably doesn't allow JS linking...I'd like to use the code you've written could you put it in something like this: http://shorttext.com/ or http://sharetext.org/And give me the link please? Link to comment Share on other sites More sharing options...
Truemedia Posted September 24, 2010 Share Posted September 24, 2010 I'm very busy with a lot of stuff atm sorry :long: , check some smarty tutorials and see if you can dig around the code for the call to the jquery file. Link to comment Share on other sites More sharing options...
GaisaMeritajs Posted September 24, 2010 Author Share Posted September 24, 2010 i meant just what u already wrote up there? Link to comment Share on other sites More sharing options...
Truemedia Posted September 24, 2010 Share Posted September 24, 2010 oh ok Iv'e attached it as file, that should work.EDIT: This forum really rejects anything not in the development section so i'll add link later Link to comment Share on other sites More sharing options...
GaisaMeritajs Posted September 24, 2010 Author Share Posted September 24, 2010 LOL!!thanks man Link to comment Share on other sites More sharing options...
Truemedia Posted September 24, 2010 Share Posted September 24, 2010 Change the file extension to tpl and also make sure the code is correct and working, I'm not a pro with smarty. sample.txt Link to comment Share on other sites More sharing options...
GaisaMeritajs Posted September 24, 2010 Author Share Posted September 24, 2010 Thanks! I'm a nothing at smarty... for now! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now