.info file not loading javascript drupal [closed]
I added these script tags to my .info file in hopes that they would be output by the $scripts variable in my header. I cleared my cache and they are still not there.
$Id$
name = site
base theme = boron
core = 6.x
engine = phptemplate
; We do not have a Left sidebar.
;regions[left] = Left sidebar
; We do not have a right sidebar.
;regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
scripts[] = sitename/sites/all/themes/custom/jivamukti/js/jquery.nivo.slider.pack.js
scripts[] = sitename/sites/all/themes/custom/jivamukti/js/scripts/jquery-1.6.1.min.js
I put the JS in the root of the themes folder i am using instead of at /js and now it is output in this function in my header
jQuery.开发者_运维知识库extend(Drupal.settings,...
how do i just get it to display inside tags
I'm afraid you're unlikely to get this working, Drupal 6 is not remotely compatible with jQuery 1.6. The highest you can stably go at the moment is 1.3.2 using the jQuery Update module.
The best thing you can do is install the jQuery update module, and manually swap out the jQuery library file with version 1.4 (the minimum that Nivo slider requires). There's a question here with some more information.
Other than that do what maged adel suggests and change the paths so that they're relative to the location of the .info
file, not the server root.
UPDATE
There's a very good post on Drupal.org with an extended discussion on the subject.
can you try this
scripts[] = js/scripts/test.js
scripts[] = js/scripts/jquery-1.6.1.min.js
scripts[] = js/jquery.nivo.slider.pack.js
and insert this test code inside your test.js file
jQuery.ready(startfunction) ;
function startfunction() {
alert("hellooo") ;
}
then clear the cache
精彩评论