Jump to content

Loading Pictures in a Ajax Website


winmastergames

Recommended Posts

I have a Ajax website HERE: http://www2.winmastergames.com/AJAXTEST-3509/bloodscars/index.html

If you click Home you can see the image borders but then it goes blank whats wrong is there another way to load Images in Ajax because i have only just started using ajax

Link to comment
https://forums.phpfreaks.com/topic/80078-loading-pictures-in-a-ajax-website/
Share on other sites

you have multiple javascript errors coming up on page load.  'object not found' was one of them.  The way you load a new image with ajax is you send an image tag back through the ajax pipe and them push that into your page object:

 

<div id="someID"></div>
<script>
    // I'm simulating an ajax return of an image tag below
    ajaxreturn = '<img src="http://domain.com/graphic.gif">';
    document.getElementById('someID').innerHTML = ajaxreturn;
    // at this point, the image 'graphic.gif' should be showing in the div
</script>

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.