picnictutorials — 2010-07-16T10:59:36-04:00 — #1
I'm trying to combine a few Google Custom Search js snippets and links into one file. Mainly for ease of editing. This is going in .html pages. I know I could use .htaccess to run php on the page in order to use SSI's but it's not worth the possible performance hit for this one piece as the rest of the site is plain html. I figured I would just use document.write to insert the script link into the other but this does not work for some reason. Save the document.write lectures please. Should this work? Or maybe something about the google script needs to run on it's own? Or should this not work and you know how to make it work? Thanks!
picnictutorials — 2010-07-16T11:42:08-04:00 — #2
Secondly, if you put a document.write statement in a external js script is the document.write stuff cached along with the external js link?
trilli — 2010-07-16T11:11:51-04:00 — #3
maybe you are doing it wrong, you can do it like this:
- Link one js file
var ar = new Array();
for(var i = 0; i < ar.length; i++)
var el = document.createElement('script');
I hope that this will help you
picnictutorials — 2010-07-16T11:21:52-04:00 — #4
Hello, unfortunately I can't do that because the link does not reside on my server. Normally I would just copy and paste it onto to mine but it's a large google search script. Who nows how often they update that ya know.