묻고답하기

아래소스는 이미지 게시판 최근글 출력하는 부분임니다...

이 부분에서 문제점이 하나 있는데..

게시판 제목에 " " 를 넣을때 오류가 발생한다는 것입니다...

자바스크립트에서는 " " 이 처리를 어케 해야 하는지요....



<script language="javascript">
//Math.random()

        var scrollerheight=610;                // 스크롤러의 세로
        var html,total_area=0,wait_flag=true;
        
        var bMouseOver = 1;
        var scrollspeed = 1;                // Scrolling 속도        
        var waitingtime = 3000;                // 멈추는 시간
        var s_tmp = 0, s_amount = 122;
        var scroll_content=new Array();
        var startPanel=0, n_panel=0, i=0;
        
        function startscroll()
        { // 스크롤 시작
                i=0;
                for (i in scroll_content)
                        n_panel++;
                        
                n_panel = n_panel -1 ;
                startPanel = Math.round(Math.random()*n_panel);
                if(startPanel == 0)
                {
                        i=0;
                        for (i in scroll_content)
                                insert_area(total_area, total_area++);
                }
                else if(startPanel == n_panel)
                {
                        insert_area(startPanel, total_area);
                        total_area++;
                        for (i=0; i<startPanel; i++)
                        {
                                insert_area(i, total_area);
                                total_area++;
                        }
                }
                else if((startPanel > 0) || (startPanel < n_panel))
                {
                        insert_area(startPanel, total_area);
                        total_area++;
                        for (i=startPanel+1; i<=n_panel; i++)
                        {
                                insert_area(i, total_area);
                                total_area++;
                        }
                        for (i=0; i<startPanel; i++)
                        {
                                insert_area(i, total_area);
                                total_area++;
                        }
                }
                window.setTimeout("scrolling()",waitingtime);
        }
        function scrolling(){ // 실제로 스크롤 하는 부분
                if (bMouseOver && wait_flag)
                {
                        for (i=0;i<total_area;i++){
                                tmp = document.getElementById('scroll_area'+i).style;
                                tmp.top = parseInt(tmp.top)-scrollspeed;
                                if (parseInt(tmp.top) <= -scrollerheight){
                                        tmp.top = scrollerheight*(total_area-1);
                                }
                                if (s_tmp++ > (s_amount-1)*scroll_content.length){
                                        wait_flag=false;
                                        window.setTimeout("wait_flag=true;s_tmp=0;",waitingtime);
                                }
                        }
                }
                window.setTimeout("scrolling()",1);
        }
        function insert_area(idx, n){
                html='<div style="left: 0px; width: 100%; position: absolute; top: '+(scrollerheight*n)+'px" id="scroll_area'+n+'">n';
                html+=scroll_content[idx]+'n';
                html+='</div>n';
                document.write(html);
        }


    // 스크롤 내용
    <?
    $id = "good01"; //불러낼 게시판 이름
    $result = @mysql_query("select * from zetyx_board_$id where is_secret!='1' order by no desc limit 10"); // 최근에 게시된 게시물 중에서 10개만 뽑아와서 출력함
    $result_category = @mysql_query("select * from zetyx_board_category_$id");
    $i = 0;$j = 0;
    while($data=@mysql_fetch_array($result))        {
        $subject = cut_str(stripslashes($data[subject]),10)."</font></b>";
        if($i==0) {
            echo "scroll_content[".$j."]="";
        }
        echo "<table cellpadding=0 cellspacing=0><tr><td height=102><a href='./bbs/view.php?id=$id&no=$data[no]'><img src=$_zb_path".$data[file_name2]." width=100 height=100 border=1 style='border-color:#999999'></td></tr><tr><td height=20 align=center><a href='./bbs/view.php?id=$id&no=$data[no]'>".$subject."</a></td></tr></table>";
        $i++;
        if($i==5) { //불러낼 최근게시제목 수
            echo "";nt";
            $i = 0; $j++;
        }
    }
    ?>

</script>

</p><div style="width: 102; height: 122px; overflow:hidden;" onMouseover="bMouseOver=0" onMouseout="bMouseOver=1" id="scroll_image">
        <script>startscroll();</script>
</div>

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
윤희석 플래시MX로 메뉴를 만들고나서 문의점 [2] 2007.08.10
홍성국 팝업창에서 크기변화 어떻게 하는거죠??  
조사장 분할된 프레임으로 링크를걸려고하는데요... [1] 2007.08.10
Khal 그.. 수직으로 줄 긋는 거.. [6] 2007.08.10
박희정 최근게시물에 관해서요. [1] 2007.08.10
김민규 [PHP] each함수와 foreach구문에 대한 질문이요. [4] 2007.08.10
WEd™ 객체를 이용하여 파일 업로드 작업할때말이죠.. [1] 2007.08.10
안기성 db table 수정 관련.. [1] 2007.08.10
CityBoys-Life 제로보드에서의 "인기검색어"? [3] 2007.08.10
김성용 쇼핑몰.. [1] 2007.08.10
김준근 카운터 다는 법 [1] 2007.08.10
다라나 모질라에서 클립보드로 데이터 넣는 자바 스크립트가 있나요? [1] 2007.08.10
박희정 글의 위가 짤렸어요.  
enjoymina 플래쉬 메뉴가 해당 페이지를 인식하게하려면...  
강정수 가격대별 검색에 관한 질문  
최재갑 자바스크립트 질문... [4] 2007.08.10
김희경 아무나 못 열어보게~ [4] 2007.08.10
stonefree 음악링크에 관해 질문드려요. [1] 2007.08.10
구름 회원정보 관련 최근로그인 나타내기.. [1] 2007.08.10
☆*HaNuL*☆ php로 폼메일 만들때 서버쪽 조건? [1] 2007.08.10
제주도의향기 무료 홈피레이아웃에서요~ [1] 2007.08.10
뛰뛰빵빵''㉨'' 잇잖아요.. [3] 2007.08.10
조성미 서버에서 PHP를 지원 안한다네여... [2] 2007.08.10
Na:) 답변부탁드립니다. [2] 2007.08.10
mcmic 외부접속이 되지 않습니다. [2] 2007.08.10
제이 한 개의 서버에서 두개의 홈피 운영하는 방법이 궁금합니다. [1] 2007.08.10
dragon http://를 붙이지 않으면 인터넷페이지가 열리지 않아요.. [2] 2007.08.10
김정환 포토샾에서 글씨를 쓰려구하는데...  
Lucia 제가 포토샵 초짜라서 그런데요. [1] 2007.08.10
한상명 [포토샵] 글씨가 써지지 않습니다.