例如我们要在页面加载完后,自动给某个div赋值,div的id假设为mytest
drupal外的项目写法
$(function(){ $("#mytest").html('喂,学习啦~~!'); });
但是如果你在drupal中还这么写,你会发现报$ is not a function,
其实在drupal中,可以这么写
jQuery(function(){ jQuery("#mytest").html('喂,学习啦~~!'); });
转载于:https://blog.51cto.com/ableengine/1158656