Jump to content

Firefox / IE weird discrepency...


BaconBeast321

Recommended Posts

Hi there, I have a page that when you click on a picture in firefox it opens a new window and displays the picture, but when you do it in IE
it opens the window but no picture.. you can view the page here...

http://www.autramping.unigroups.co.nz/viewadj.php?jc=Tarantula%20Nebula
-
Heres the script im using


<SCRIPT LANGUAGE="JavaScript">

function openpic1()
      {
OpenWindow=window.open("", "newwin", "height=600, width=800,toolbar=no,scrollbars="+scroll+",menubar=no");

OpenWindow.document.write("<BODY BGCOLOR=black leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>")

OpenWindow.document.write("<IMG SRC='upload/<?php echo("$jc"); echo '1.jpg' ?>' height=x'>")

OpenWindow.document.write("</BODY>")
OpenWindow.document.write("</HTML>")

OpenWindow.document.close()
self.name="main"
    }
</SCRIPT>






<?php
if($oneisthere > "0") {
echo '<td class=mid align=left><img src="upload/';

echo("$jc");
echo '1.jpg" onClick="openpic1();" width="120" height="90"></td>';
}
?>









The view source through IE looks like this:

<BODY BGCOLOR=black leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0><IMG SRC='upload/Tarantula Nebula1.jpg' height=x'></BODY></HTML>

It looks like maybe it needs  " instead of ' around the image name but if I try to add that in the script I get a php error
Link to comment
https://forums.phpfreaks.com/topic/17214-firefox-ie-weird-discrepency/
Share on other sites

[code=php:0]
<SCRIPT LANGUAGE="JavaScript">

function openpic1()
      {
OpenWindow=window.open("", "newwin", "height=600, width=800,toolbar=no,scrollbars="+scroll+",menubar=no");

OpenWindow.document.write("<BODY BGCOLOR=black leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>")

OpenWindow.document.write("<IMG SRC=\"upload/<?php echo("$jc"); echo "1.jpg"; ?>\" height=\"PUT AN ACTUAL HEIGHT HERE OR JUST DELETE THIS HEIGHT TAG\">")

OpenWindow.document.write("</BODY>")
OpenWindow.document.write("</HTML>")

OpenWindow.document.close()
self.name="main"
    }
</SCRIPT>






<?php
if($oneisthere > 0) {
echo "<td class=\"mid\" align=\"left\"><img src=\"upload/";

echo $jc . "1.jpg" onClick=\"openpic1();\" width=\"120\" height=\"90\"></td>";
}
?>
[/code]

Try that and see if it works any better

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.