우선 문제가 되는 코드 입니다.
Copy
<table id="tbl_search_model" style="position:absolute; visibility:hidden; top:0; left:0"><tr><td><iframe id="ifr_search_model" width="0" height="0" scrolling="1" frameborder="0" STYLE="BORDER: #d3d3d3 3px solid;"></iframe></td></tr></table><script><!--$(".jaehu_sangdam_search").click(function(e){ tbl_search_model.style.visibility = 'visible'; tbl_search_model.style.zIndex = '10000'; var x = (e.pageX) ? e.pageX : document.body.scrollLeft+event.clientX; var y = (e.pageY) ? e.pageY : document.body.scrollTop+event.clientY; document.getElementById('ifr_search_model').style.width = 600 + 'px'; document.getElementById('ifr_search_model').style.height = 500 + 'px'; document.getElementById('tbl_search_model').style.top = y; document.getElementById('tbl_search_model').style.left = x - 200; ifr_search_model.location.replace("<?=$admin_site_path?>/sinchung/jaehu_sangdam_view.htm?jaehu_code="+$(this).attr("jaehu_code")+"&menu_code=19&menu2_code=39"); }); </script>
위 코드는 클릭하면 id="ifr_search_model"의 iframe이 replace되는건데요....이게 IE에서는 작동을 하는데 크롬이나 MS엣지등에서는
Copy
이 부분에 ifr_search_model.location.replace("<?=$admin_site_path?>/sinchung/jaehu_sangdam_view.htm?jaehu_code="+$(this).attr("jaehu_code")+"&menu_code=19&menu2_code=39");
Uncaught TypeError: Cannot read property 'replace' of undefined
이런 오류가 나면서 작동을 하지 않고 있습니다.
스크립트를 body밑에 위치 시키라는 글을 보고 해봤는데 마찬가지였습니다.
어떤 문제고 어떻게 해결해야 될까요;;;
답변 1개
채택된 답변
+20 포인트
iBNeer
2016-08-02 (화) 15:40:44
답변을 작성하려면 로그인이 필요합니다.