问题描述
我的一个皮肤/主题的左侧栏中有一个 HTML/文本默认模块.我在那里有一些 Javascript 我试图将今天的日期设置为我的 javascript 日期下拉列表.我无法使用body.onLoad",因为 Drupal 以某种方式阻止了它?
I have a HTML/text default module in the left bar of one of my skins/themes. I have some Javascript in there I'm trying to set today date to my javascript date dropdowns. I am unable to use 'body.onLoad' because Drupal is blocking it somehow?
我找到了一个解决方案,说我可以在这里添加我的 javascript 函数:如果(isJsEnabled()){addLoadEvent(yourCustomJSFunction);}
I found a solution saying I can add my javascript function here: if (isJsEnabled()) { addLoadEvent(yourCustomJSFunction); }
如果我只使用默认的 HTML/文本模块,我该如何添加?
How can I add that if I'm just using a default HTML/text module?
谢谢!
推荐答案
Drupal 使用 jQuery JavaScript 库.您编写的用于 Drupal 的任何 JavaScript 最好也应该使用 jQuery.查看 api 上的 JavaScript 启动指南.drupal.org 了解一些基础知识,特别是 Drupal.behaviors 部分.
Drupal uses the jQuery JavaScript library. Any JavaScript you write to work with Drupal should ideally use jQuery as well. Check out the JavaScript Startup Guide on api.drupal.org for some basics, particularly the Drupal.behaviors section.
这篇关于在 Drupal 中为 OnLoad 添加一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)