4

Preloading external JS files in page-front.tpl.php

http://drupal.org

Hi,
I am trying to preload a JS file inside [page-front.tpl.php] file by using below code.

<script type="text/javascript">
$(document).ready(function() {
$.getScript('http://Example/FolderName/js/example.js');});
</script>

this works but when i look at the page source i see some dynamic code getting added after file name. now this is because i want this JS file to be cashed, but since each time when the page is refreshed the dynamic id get's changed.

Please help me to remove the dynamic id getting added to the file name.
or is there any other way to pre load external JS files

Thanks in Advance,
AnAnD

Read »
Created by twobits 1 year 26 weeks ago
Category: Tutorials   Tags:

PSD to Drupal Theme

Drupal Development

Module Development

Get an Estimate

Tags for Preloading external JS files in page-front.tpl.php

Recent comments