Błędna interpretacja skryptu javascript

w dziale Strony WWW w Operze
Tetriando napisał(a):

echo '<script type="text/javascript">
 
var max_width = 350;
var max_height = 350;

function resize_image(img) {

if(img.width > img.height){
    if(img.width > max_width) {
        factor = img.width / img.height;
        height = Math.floor(max_width / factor);
        img.width = max_width;
        img.height = height;

        var newdiv = document.createElement(\'div\');
        newdiv.className = \'resize_image\';
        newdiv.innerHTML = \'<a href="\' + img.src +\'" onclick="this.target=\\\'_blank\\\'"><img src="\' + img.src +\'" height="\' + height +\'" width="\' + max_width +\'" alt="" title="Kliknij aby powiększyć."></a>
<p style="width:\' + max_width +\';">Kliknij na obrazek aby go powiększyć.</p>\';
        img.parentNode.insertBefore(newdiv, img);
        img.parentNode.removeChild(img);

    }

}

else{
    if(img.height > max_height) {
        factor = img.height / img.width;
        width = Math.floor(max_height / factor);
        img.height = max_height;
        img.width = width;
		
		var newdiv = document.createElement(\'div\');
        newdiv.className = \'resize_image\';
        newdiv.innerHTML = \'<a href="\' + img.src +\'" onclick="this.target=\\\'_blank\\\'"><img src="\' + img.src +\'" height="\' + max_height +\'" width="\' + width +\'" alt="" title="Kliknij aby powiększyć."></a>
<p style="width:\' + max_width +\';">Kliknij na obrazek aby go powiększyć.</p>\';
        img.parentNode.insertBefore(newdiv, img);
        img.parentNode.removeChild(img);
		
    }

}
} 

</script>'; 



Na firefoxie i chrome działa, na operze i ie 8 nie

smqzbq napisał(a):

a mógłbyś dać ten skrypt działający na FF na konkretnej stronce a nie wycięty z php?p na ktorej operze to nie dziala? -ps w kazda opere wbudowana jest konsola js to mógłbys podać w sumie co opera wypisuje.

nowotny napisał(a):

Originally posted by Tetriando:

Na firefoxie i chrome działa, na operze i ie 8 nie


Hmm... U mnie działa bez problemu... Co ci KONKRETNIE nie działa...?