【问题标题】:Drupal 7 Add jQuery File to all pagesDrupal 7 将 jQuery 文件添加到所有页面
【发布时间】:2013-12-18 21:22:56
【问题描述】:

我在这里查看了 drupal 的主页:https://drupal.org/node/171213,但仍然出现错误。

在我的 .info 文件中,我添加了代码:

stylesheets[all][] = template.css
scripts[] = megamenu.js

我了解不需要样式表。我只是把它放在那里以参考它在我的代码中的外观。

我检查了我的 Google Chrome Web-Dev 设置,它甚至没有加载 .js 页面,这让我相信我在 .info 文件中做错了什么。有人知道我哪里出错了吗?

谢谢!

【问题讨论】:

  • 你清除了主题缓存吗?
  • @KellyJAndrews - 哈哈,好有趣的故事……我告诉自己我不会忘记那部分……然后我忘了做那部分。谢谢!
  • 发生在我们最好的人身上。

标签: javascript jquery drupal drupal-7


【解决方案1】:

根据我上面的评论,清除主题缓存可以解决问题。

【讨论】:

    【解决方案2】:

    $form['#attached']['js'] = array(drupal_get_path('module', 'billing') . '/billing.js' => array( '类型' => '文件', ));

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多