开发者

.info file not loading javascript drupal [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜