Certain js File Not Working in Drupal

I'm trying to render one div before another. I've tested the js on my local machine to make sure it works by creating a simple page. The code is as follows:
IMAGE
BODY
I've added the following code to a js file on my Drupal site: (function ($, Drupal, window, document, undefined) { $('.content .body').insertBefore('.content .field-name-field-image-one'); // check before() examples })(jQuery, Drupal, this, this.document); My .info file links to the js and it is loading. Other elements that require javascript are working too. I've even tried adding the script in the html.tpl file, but that did not work either. The divs I am trying to affect are nested deep within the html markup, and have several classes applied to them, compared to the simple version I have made. Could that be the reason? Am I not being specific enough?

以上就是Certain js File Not Working in Drupal的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏