Hi guys I am having some weird problem with Firefox and IE. I haven't faced such problem before this so please help. I made a custom image browser to work with ckeditor. The browser(a popup window) window opens as expected but when when I try to return the fileUrl or run any type of javascript nothing happens in case of Firefox and IE. Everything's fine with chrome.
Browser page code:
<?php
$path = "./public/user_images/demo_user/";
if(is_dir($path) == true){
$list = scandir($path);
if(count($list) >= 1){
foreach ($list as $key=>$value) {
if(is_file($path.$value)){
$file = base_url($path.$value);
echo <<<start
<button class="btn_browser_img">
<img src="$file" class='browser_img'><img>
</button>
start;
}
}
}
}else{
echo "Oops! Wrong folder...";
}
?>
Background Javascript:
$(".browser_img").click(
function(){
alert(this.getAttribute('src'));
fileUrl = this.getAttribute('src');
sendFileUrl(fileUrl);
}
);
function sendFileUrl(fileUrl){
window.opener.CKEDITOR.tools.callFunction( funcNum, fileUrl );
window.close();
}