하나의 div를 다른 div 앞에 렌더링하려고합니다.특정 js 파일이 Drupal에서 작동하지 않습니다.
로컬 컴퓨터에서 js를 테스트하여 간단한 페이지를 만들어 작동하는지 확인했습니다. JS에
(function ($, Drupal, window, document, undefined) {
$('.content .body').insertBefore('.content .field-name-field-image-one'); // check before() examples
})(jQuery, Drupal, this, this.document);
내 .INFO 파일 링크를 그리고로드 :
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div id="QWERTY">
<div class="content">
<div class="field-name-field-image-one">IMAGE</div>
<div class="body">BODY</div>
</div>
</div>
<script>$('.content .body').insertBefore('.content .field-name-field-image-one'); // check before() examples</script>
</body>
</html>
나는 내 드루팔 사이트에 JS 파일에 다음 코드를 추가 한 다음과 같이 코드입니다. 자바 스크립트를 필요로하는 다른 요소들도 효과적입니다. 나는 html.tpl 파일에 스크립트를 추가하려고 시도 했는데도 작동하지 않았다.
영향을주고 싶은 div는 html 마크 업 내에 중첩되어 있으며, 내가 만든 간단한 버전과 비교하여 여러 클래스가 적용되어 있습니다. 이유가 될 수 있을까요? 충분히 구체적이지 않습니까? 도움을