묻고답하기

XE로 사이트를 구축중입니다.

간단한 회사소개 페이지를 만드는 중인데,

레이아웃을 제외한 내용부분에는, {$content}

내용직접추가를 클릭해 그곳의 에디터를 통하여 내용을 입력하고 있는 중입니다.

 

FAQs 작업중에 Java scripts의 기능을 꼭 넣어야 할 일이 생겼는데,

글쓰기 에디터의 html편집기를 클릭하여 <script type=""text/JavaScript"> </script> 안에 해당 스크립트를 넣어주는데,

자꾸만 사라지내요.

주변에 분들께 여쭤보니 xe게시판이 웹표준을 지키기대문에, 표준이 아닌 자바스크립트는 입력되지 않을거다..

라고 하시는데, 그 표준의 자바스크립트 또한 모르겠습니다.ㅠ

 

제가 입력한 자바스크립트는 다음과 같습니다.

xe게시판에 자바스크립트를 사용할 수 있는 방법을 알려주세요!!!

 

이렇게 불러오는 방법도 써보았습니다 ㅠ_

<script type="text/JavaScript" src="/js/faq.js"></script>

 

 

var enablepersist="off" //쿠키사용 on 미사용 off
var collapseprevious="yes" //yes : 하나 확장되면 다른건 확장 안됨, no : 전체 다 확장할 수 있슴..

var contractsymbol='- ' //확장시 기호 (이미지 대체 가능)
var expandsymbol='+ ' //미확장시 기호 (이미지 대체 가능)


if (document.getElementById){
    document.write('<style type="text/css">')
    document.write('.switchcontent{display:none;padding-left:12px;}')
    document.write('</style>')
}

function getElementbyClass(rootobj, classname){
       var temparray=new Array()
    var inc=0
    for (i=0; i<rootobj.length; i++){
    if (rootobj[i].className==classname)
        temparray[inc++]=rootobj[i]
    }
    return temparray
}


function contractcontent(omit){
    var inc=0
    while (ccollect[inc]){
    if (ccollect[inc].id!=omit)
        ccollect[inc].style.display="none"
        inc++
    }
}

function expandcontent(curobj, cid){
    var spantags=curobj.getElementsByTagName("SPAN")
    var showstateobj=getElementbyClass(spantags, "showstate")
    if (ccollect.length>0){
    if (collapseprevious=="yes")
        contractcontent(cid)
        document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
    if (showstateobj.length>0){ //if "showstate" span exists in header
    if (collapseprevious=="no")
        showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
    else
        revivestatus()
        }
    }
}

function revivecontent(){
    contractcontent("omitnothing")
    selectedItem=getselectedItem()
    selectedComponents=selectedItem.split("|")
    for (i=0; i<selectedComponents.length-1; i++)
        document.getElementById(selectedComponents[i]).style.display="block"
}

function revivestatus(){
    var inc=0
    while (statecollect[inc]){
    if (ccollect[inc].style.display=="block")
        statecollect[inc].innerHTML=contractsymbol
    else
        statecollect[inc].innerHTML=expandsymbol
        inc++
    }
}

function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search)
    if (offset != -1) {
        offset += search.length
        end = document.cookie.indexOf(";", offset);
    if (end == -1) end = document.cookie.length;
        returnvalue=unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}

function getselectedItem(){
    if (get_cookie(window.location.pathname) != ""){
        selectedItem=get_cookie(window.location.pathname)
    return selectedItem
    }
    else
    return ""
}

function saveswitchstate(){
    var inc=0, selectedItem=""
    while (ccollect[inc]){
    if (ccollect[inc].style.display=="block")
        selectedItem+=ccollect[inc].id+"|"
        inc++
    }
document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
    uniqueidn=window.location.pathname+"firsttimeload"
    var alltags=document.all? document.all : document.getElementsByTagName("*")
        ccollect=getElementbyClass(alltags, "switchcontent")
        statecollect=getElementbyClass(alltags, "showstate")
    if (enablepersist=="on" && ccollect.length>0){
        document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
        firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
    if (!firsttimeload)
        revivecontent()
    }
    if (ccollect.length>0 && statecollect.length>0)
        revivestatus()
    }

    if (window.addEventListener)
        window.addEventListener("load", do_onload, false)
    else if (window.attachEvent)
        window.attachEvent("onload", do_onload)
    else if (document.getElementById)
        window.onload=do_onload

    if (enablepersist=="on" && document.getElementById)
        window.onunload=saveswitchstate

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
kingmoney 네이트 원격조정으로 xe좀 다운로드좀 봐주실분...  
센스티브 전화번호부 위젯  
컴심 autoinstall  
나루시아 xe 링크 게시판에 대해서; [2] 2010.06.28 by 시고라
무비클립 shopXE 상품등록 이미지 엑박 문제질문  
눈팅superior ie6에서 상단 로고가 2개 뜹니다.  
미나기 회원별 게시판 필터링  
xe배우자 전국지도에 링크하는 기능 없나여 ? [1] 2010.06.28 by RoricTree
술먹는하마 신디케이션 no exist site 는 해결 방안 아직 없는 건가요? ㅜㅜ [1] 2010.06.28 by 老姜君
flyanne 최근게시물 - 각 게시글 제목 클릭 시 해당 게시판 목록으로 넘어가게 하고싶습니다.  
딩디링 XE의 "내용직접추가" 글쓰기에디터는 자바스크립트가 입력되지 않나요?  
권이 제로보드로 알림문자 서비스 가능한가요?  
쥰지 변수 설정 관련 PHP 질문 드립니다.  
어리둥절 홈페이지 DB관리에 대해 도움을 받을 수 있는 곳이 없을까요? [4] 2010.06.28 by 銀童
차니나라 날짜 수정하는 기능은 없나요? [2] 2010.06.28 by eunbini
rjsrhs syndication 문서출력 동작확인  
나루시아 xe 링크 게시판 어떻게 만드나여?? [2] 2010.06.28 by nabul2
규규 회원에게 각각 게시판 하나씩을 분양하고 싶습니다.  
초보자2222 모듈을 설치하다 보니 아예 사이트 주소가 사라져 버렸습니다. [1] 2010.06.28 by 구가
어리둥절 DB에 xe_documents테이블 에러는 어떻게 해야하나요?  
goedokid XE로 만든 홈페이지 소스는 어디에 있나요? [1] 2010.06.27 by guny
soulhack xe 설치 초반 문제 ㅠㅠ file  
이태배기 주소가 자꾸 바귑니다 [1] 2010.06.27 by 초보자2222
주하니 인증메일 오류(한메일에 인증 링크없이 옴)  
초보자2222 XE에서 페이지를 만들때, 상자 위치를 어떻게 지정하죠? [1] file 2010.06.27 by LutZ
떠오른햇님 ''조회 수''를 ''조회''로 바꾸는 법 [1] 2010.06.27 by 감로수
초보자2222 제발 도와주세요!!! 제 홈피가 계속 이곳 xpressengine.com 으로 이동합니다/ [1] 2010.06.27 by 일모도원
ㅈㄷㄹㅈㄷㅎㄹㅈ img_count 질문입니다  
icerei 아이폰과 아이패드에선 자바스크립트 안되나요? [2] 2010.06.27 by nullptr
윤석원287 썸네일 이미지가 짤려서나와요... [1] 2010.06.27 by LutZ