Jump to content

[SOLVED] Content of image rather than image displaying


stockton

Recommended Posts

In the following code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript">
(document.getElementById) ? dom = true : dom = false; //select ie mozilla
function hideIt() {
    if (dom) {document.getElementById("layer1").style.visibility='hidden';} //ie
    if (document.layers) {document.layers["layer1"].visibility='hide';}  //mozilla
    }
function showIt(image) {
    $(document).ready(function() {
            $('#bigimage').load(image);
    });
    if (dom) {document.getElementById("layer1").style.visibility='visible';
        document.getElementByID('bigimage').src=image;}
    if (document.layers) {document.layers["layer1"].visibility='show';
        document.getElementByID('bigimage').src=image;}
    }
    onResize="window.location.href = window.location.href";
</script>
</head>
<body>
      <img src='images/dogs/PB030060A_thumb.JPG' onClick="showIt('images/dogs/PB030060A.JPG');">
      <img src='images/dogs/P4220081B_thumb.JPG' onClick="showIt('images/dogs/P4220081B.JPG');">
      <img src='images/dogs/P4220084B_thumb.JPG' onClick="showIt('images/dogs/P4220084B.JPG');">
      <img src='images/dogs/P6050086A_thumb.JPG' onClick="showIt('images/dogs/P6050086A.JPG');">
      <div id="layer1" style="position:fixed; left:20px; width:65%; top:20px; visibility:hidden;">
      <img id='bigimage' src='blank.jpg' onClick="hideIt();" alt='Click to close this image'>
      </div>

</body>
</html>

I get the bigimage image contents(?hex?) to dispay rather than the image itself.

This can be seen at http://www.stockton.co.za/prince1.shtml and click on a thumbnail.

Please tell me how I got this wrong.

 

Link to comment
Share on other sites

Actually it does, you're loading the image via ajax which makes no sense at all, try opening the very same image in your text editor.. it will look the same.

 

Solution is also already provided, change the src attribute to point to the URL of the image.

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.