Sunday 15 July 2012

php - Refreshing Dynamic Images Using jQuery -


I am trying to create a list of twitch.tv streams that pulls online / offline status every 60 seconds and An image gives the Php code based on that response I am using this information to draw and return the image below:

    

This part works well I'm calling this code (image.php) as such:

     

And all this works, but it is not alive. I have tried many things so that it can be refreshed and arranged on jQuery. I think what I need to do is add some header information that does not allow the browser to cache the image and maybe keep it in the div that every 60 seconds in jQuery is refreshed, but this is where I Brick walls have been hit. Any suggestion in this regard how can it be done? I'm relatively new to jQuery and here a bit dislikes around, so any help would be greatly appreciated.

To avoid cached images, I have included several possible solutions, such as the date or time of the URL, but since it is already a dynamic image URL, I am not sure how to do that work. / P>

Thanks in advance for any help.

OK, so it may be strange to answer your own question, though I Basically the problem presented is an partial solution:

I used to think of using jquery to automatically refresh a div with this kind of nausea The situation is as follows:

First of all, jquery in my doctor's header is called:

    

Then, under the body section of the file:

    

And finally, around the code with the image in it:

  & lt; Div id = "twitchStatus" & gt; Nameofstreamgoes is & lt; Img style = "margin-down: 0 pixels;" Alt = "" src = "image.php? Stream = namefast smack" /> & Lt; / Div & gt;   

So my current problem is? It works perfectly in Chrome, but not IE or Firefox ... does anyone take anyone? I thought this page might be caching - because it does not look quite fresh, so at the end of the body is the first part of the script, but he did nothing, any help would be greatly appreciated.

No comments:

Post a Comment