묻고답하기

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 남기남
애치티 썸네일 생성 안되는 경우.... [5] 2008.12.31 by 애치티
nabis 외국 godaddy.com 호스팅에서 제로보드인스톨이 안됩니다... [1] file 2008.12.31 by 애치티
박성준 포토샵으로 index메인을 잡고 html로 만들었습니다. 이제 어떻게 해야하나요?? [1] 2008.12.31 by 느까끼
hers 배경색을 변경하려고 하는데... [2] file 2008.12.31 by hers
원습앙 제로보드 xe 폴더가 강제삭제가 안돼요 ㅠㅠ [1] 2008.12.31 by 느까끼
왜만지냐 1.0.5에서 1.1.3으로 업그레이드 했는데요 [1] 2008.12.31 by 백성찬
어렵네요 myadmin 페이지 외부에서 접속시 forbidden이라고 뜨네요.. [6] 2008.12.31 by 애치티
새올 제로보드 XE 전광판 기능 설치하는방법? [4] 2008.12.31 by 새올
Rin XE > XE 마이그레이션 시 댓글 순서 문제 [1] 2008.12.31 by SMaker
raystorm 메인의 위젯 배열순서 참고 부탁드립니다. [2] file 2008.12.31 by SMaker
yanagi4u.myid.net 금지 IP에 등록된 IP는 어떻게 푸나요? [1] file 2008.12.31 by 백성찬
명우 설문조사 비공개 투표 문의 [1] 2008.12.31 by SMaker
닉네임* 그룹별 회원별 로그인후 초기접속페이지 설정 [1] 2008.12.31 by SMaker
영달이 업그레이드 후 잘 사용하다가 파일첨부가 안되네요..... [3] 2008.12.31 by 동물
송혜교남펀 업데이트 후 위젯이 안돼요 ㅠ ㅜ [1] 2008.12.31 by 애치티
애치티 네이버 지도 작업 .. [4] 2008.12.31 by 애치티
^^ 갑자기 가로스크롤이 생겻어요 [2] 2008.12.31 by 느까끼
장뚱이 Xe 카운터>> 동일 아이피 히트수 올라가나요? [4] 2008.12.31 by 세기박
플래닛 플래닛 최근글 위젯으로 추출 시 [2] 2008.12.31 by 백성찬
조진용330 [인코딩] xe 설치 후 텍스트 깨짐. [3] file 2008.12.31 by 백성찬