wr_link 를 메인화면에서 즐겨찾기식으로 버튼출력 문제

<script type="text/javascript">
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>



<? // 링크
if ($list[$i]['wr_link1']) {
echo "<a href='javascript://'onclick='window.external.AddFavorite({$list[$i]['wr_link1']})' target=_self>";
echo "<img src=\"{$latest_skin_path}/img/favorite.gif\" align='absmiddle' border=0>";
echo "</a>";}
?>


어디가 틀렸을까요?

에러나네요
|

댓글 2개

<?php
if($list[$i]['wr_link1']) {
echo '<a href="{$list[$i]['wr_link1']}" onclick="bookmarksite('사이트명', this.href); return false;" target="_self">';
echo '<img src="{$lastest_skin_path}/img/favorite.gif" align="absmiddle" border="0" alt="즐겨찾기 추가" />';
echo '</a>';
}
?>
아마 AddFavorite(에서 링크가 따옴표로 묶이지 않아서 발생하는 문제 같네요...
님이 적어준 소스가 에러나서 다르게 다시 응용해도 에러나네요.
암튼 답변 감사드립니다
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 1,536
14년 전 조회 994
14년 전 조회 969
14년 전 조회 684
14년 전 조회 828
14년 전 조회 804
14년 전 조회 926
14년 전 조회 755
14년 전 조회 977
14년 전 조회 1,506
14년 전 조회 996
14년 전 조회 900
14년 전 조회 994
14년 전 조회 710
14년 전 조회 1,113
14년 전 조회 837
14년 전 조회 780
14년 전 조회 5,613
14년 전 조회 5,042
14년 전 조회 1,606
🐛 버그신고