이게 호출이 안되네요.. 문제점이 뭔가요?
본문
function showLayer(ObShow, bo_table, fn, wr_id) {
document.getElementById(ObShow).style.visibility="visible";
document.write(" <div id='Layer1'> ");
document.write(" <a href=\"javascript:hideLayer('Layer1');\" name='ly1' value='hide 1'>close</a> ");
document.write(" <br /> ");
document.write(" </div> ");
var img_url = "../data/file/'+bo_table+'/'+wr_id+'/'+fn+";
document.write ( "<img src="+img_url+" width=600 />" );
}
<a href="javascript:showLayer('Layer1', <?php echo $bo_table ?>, <?php echo $img_file ?>, <?php echo $row['wr_id'] ?>);">
답변 4
<script type="text/javascript">
function showLayer(ObShow, bo_table, fn, wr_id) {
var img_url = "../data/file/" + bo_table + "/" + wr_id + "/" + fn;
document.getElementById(ObShow).style.visibility = "visible";
document.write(" <div id='Layer1'> ");
document.write(" <a href=\"javascript:hideLayer('Layer1');\" name='ly1' value='hide 1'>close</a> ");
document.write(" <br /> ");
document.write(" </div> ");
document.write ( "<img src=" + img_url + " width='600' />" );
}
</script>
<a href="javascript:showLayer('Layer1', '<?php echo $bo_table ?>', '<?php echo $img_file ?>', '<?php echo $row['wr_id'] ?>');">
string(문자열)의 경우는 전부 따옴표로 감싸야 합니다.
!-->
function showLayer(ObShow, bo_table, fn, wr_id) {
document.getElementById(ObShow).style.visibility="visible";
document.write("<div id='Layer1'> ");
document.write("<a href=\"javascript:hideLayer('Layer1');\" name='ly1' value='hide 1'>close</a>");
document.write("<br />");
document.write("</div>");
//var img_url = "../data/file/'+bo_table+'/'+wr_id+'/'+fn+";
var img_url = "../data/file/"+bo_table+"/"+wr_id+"/"+fn;
document.write( "<img src="+img_url+" width=600 />");
}
이렇게 되어야 하는거 아닌가요 ?
!-->안먹네요;;;
해결 방법 찾았습니다...
function hideLayer(ObHide) {
document.getElementById(ObHide).style.visibility="hidden";
}
function showLayer(bo_table, fn, wr_id) {
document.write("<div id='Layer1'> ");
document.write("<a href=\"javascript:hideLayer('Layer1');\" name='ly1' value='hide 1'>close</a>");
document.write("<br />");
var img_url = "../data/file/"+bo_table+"/"+wr_id+"/"+fn;
document.write( "<img src="+img_url+" width=600 />");
document.write("</div>");
}
ObShow 삭제
document.getElementById(ObShow).style.visibility="visible"; 삭제
ver img_url 랑 바로 밑에있던 write 위치 변경
!-->
답변을 작성하시기 전에 로그인 해주세요.