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
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.