13
A
답변
23
내가 알고 있는데 두 가지 방법이 있습니다) 당신의 템플릿의 index.php에서 직접 JS 파일을 제거 :
<?php unset($this->_scripts['/media/system/js/mootools-core.js']); ?>
0
당신은 간단하게 편집 할 수 있습니다 나는 모든 페이지에서 플러그인에게 많은 JS 파일이 포함 된 일부 페이지를 사용했다 이러한 플러그인은 이러한 파일을 제거하는 코드입니다. 필요하지 않은 경우 플러그인을 제거하십시오.
1) (당신이) 플러그인에 그렇게 할 수있는 인스턴스를 가져 문서 객체의 경우와의 js 파일을 제거 :
<?php
//get the array containing all the script declarations
$document = JFactory::getDocument();
$headData = $document->getHeadData();
$scripts = $headData['scripts'];
//remove your script, i.e. mootools
unset($scripts['/media/system/js/mootools-core.js']);
unset($scripts['/media/system/js/mootools-more.js']);
$headData['scripts'] = $scripts;
$document->setHeadData($headData);
?>
2
-7
**An easiest way to disable mootools/ unwanted javascripts for your site in joomla cms (2.5 version)**(still loads it for your admin)
**Step-1:**
Using your favorite file editor, open for edit:
libraries/joomla/document/html/renderer/head.php
**Step-2:** check for code in head.php
// Generate script file links
foreach ($document->_scripts as $strSrc => $strAttr)
{
// *** start *** //
$ex_src = explode("/",$strSrc);
$js_file_name = $ex_src[count($ex_src)-1];
$js_to_ignore = array("mootools-more.js","core.js"); // scripts to skip loading
//skip loading scripts..
if(in_array($js_file_name,$js_to_ignore) AND substr_count($document->baseurl,"/administrator") < 1 AND $_GET['view'] != 'form'){continue;}
// *** end *** //
**Step-3:**
Clear cache & refresh page.
it works for sure.
For detailed explanation : http://www.inmotionhosting.com/support/edu/joomla-25/302-disable-mootools-in-joomla-25
+5
코어 파일 수정은 권장되지 않습니다. – betweenbrain
5
는 모든 스크립트를 제거 할 경우 그 조 omla는 가장 빠른 방법이있다, 인라인 스크립트를 포함, 추가 :
$this->_script = $this->_scripts = array();
가
<head>
섹션 위의 템플릿 파일이 어느 곳을 추가합니다.
관련 문제
- 1. 내 drupal에서 원치 않는 광고를 제거하는 방법
- 2. 원치 않는 모양 제거하는 방법을 여기
- 3. T4 템플릿은 원치 않는 출력 파일을 생성합니다.
- 4. 원치 않는 파일을 만드는 크론 작업 스크립트
- 5. 페이지에서 항목을 제거하는 방법?
- 6. 아파치 원치 않는 리디렉션
- 7. 원치 않는 ftp 놀라움
- 8. CSS에서 원치 않는 클래스 제거
- 9. 원치 않는 디버그 세션
- 10. JS 파일을 포함하는 대체 방법
- 11. Eclipse RCP에서 원치 않는 도움말 메뉴를 제거하는 방법은 무엇입니까?
- 12. 원치 않는 SQL subselects 제거하는 가장 좋은 방법은?
- 13. 자식 저장소에서 원치 않는 추가 루트 커밋을 제거하는 방법은 무엇입니까?
- 14. 원치 않는 토스트 알림
- 15. 원치 않는 \ 문자
- 16. JSON 원치 않는 슬래시
- 17. 페이지에서 YUI 차트를 제거하는 방법
- 18. log4j로 원치 않는 의존성 로깅
- 19. 원치 않는 포스트 백을 중지하는 방법
- 20. Firefox에서 원치 않는 JavaScript 파일, NS_ERROR_XPC_BAD_CONVERT_JS
- 21. 원치 않는 파일 다운로드를 추적해야합니다.
- 22. PHP의 암호화로 원치 않는 문자가 남음
- 23. joomla- js 파일 호출
- 24. 원치 않는 (메타?) 루비/레일의 데이터
- 25. Joomla 페이지에서! doctype을 선언해야합니까?
- 26. html 페이지에서 결과 집합을 제거하는 방법
- 27. 페이지에서 js 변수를 선언했습니다. js 파일을 포함시키지 못했습니다.
- 28. css 파일을 제거하는 방법?
- 29. TransactionScope를 사용하여 원치 않는 프로모션
- 30. OpenERP에서 원치 않는 메뉴 비활성화
플러그인에서 자바 스크립트 파일이 필요한 경우 제거하면 문제가 발생할 수 있습니다. 플러그인 자체를 제거하는 것이 더 좋지 않겠습니까? 또한 자바 스크립트 파일을 제거해야합니다. – Okonomiyaki3000