Jump to content


Photo

Firefox / IE weird discrepency...


  • Please log in to reply
2 replies to this topic

#1 BaconBeast321

BaconBeast321
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 11 August 2006 - 06:37 AM

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.autrampin...arantula Nebula
-
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

#2 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 11 August 2006 - 08:42 AM

<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>";
}
?>

Try that and see if it works any better
Why doesn't anyone ever say hi, hey, or whad up world?

#3 BaconBeast321

BaconBeast321
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 12 August 2006 - 01:51 AM

woah thanks alot it worked a treat




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users