Refresh Image Button Needed (refreshes image only, not whole page) [fixed] - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: Refresh Image Button Needed (refreshes image only, not whole page) [fixed] (/showthread.php?tid=73812) Refresh Image Button Needed (refreshes image only, not whole page) [fixed] by prashker on 04-21-2007 at 06:39 PM
Right now I have code that when you refresh the page it changes the image automatically that is displayed. quote: Help ? RE: Refresh Image Button Needed (refreshes image only, not whole page) by MeEtc on 04-21-2007 at 06:52 PM
if the image is an <img> tag, something like this might work: code: If its a css background image, use something like this: code: RE: Refresh Image Button Needed (refreshes image only, not whole page) by Nathan on 04-21-2007 at 06:56 PM
It is infact in the body tag: using a style. RE: Refresh Image Button Needed (refreshes image only, not whole page) by MeEtc on 04-21-2007 at 06:57 PM
body? ok, ill edit the script RE: Refresh Image Button Needed (refreshes image only, not whole page) by Nathan on 04-21-2007 at 07:03 PM ah, yyou dont get sonicsam, he wants it to automatically update like a slideshow. RE: Refresh Image Button Needed (refreshes image only, not whole page) by prashker on 04-21-2007 at 07:05 PM
quote: Ok let me say it again . When you click a button like "Refresh this Image" it refreshes the image without reloading the whole page . RE: Refresh Image Button Needed (refreshes image only, not whole page) by MeEtc on 04-21-2007 at 07:05 PM no, he says: quote: if you want a slideshow, all you need to do is add the getimage() to the body onload and add a timer RE: Refresh Image Button Needed (refreshes image only, not whole page) by vaccination on 04-21-2007 at 07:06 PM
=s RE: Refresh Image Button Needed (refreshes image only, not whole page) by prashker on 04-21-2007 at 07:07 PM
quote: Nononono. quote: . Basically. So let me explain it 1 more time. http://jesuswasajew.info/ See it plays music and shows a random image? When you refresh the page, the image changes, but the music restarts, because the whole page was refreshed. I want a button, that when you click it, changes ONLY the image, and does not refresh the whole page. Ok ? RE: Refresh Image Button Needed (refreshes image only, not whole page) by andrewdodd13 on 04-21-2007 at 07:37 PM You could always use... *cough* frames *cough*. RE: Refresh Image Button Needed (refreshes image only, not whole page) by MeEtc on 04-21-2007 at 07:37 PM frames are evil RE: Refresh Image Button Needed (refreshes image only, not whole page) by prashker on 04-21-2007 at 07:38 PM
quote: Yes I know I could, but I dont want to . RE: Refresh Image Button Needed (refreshes image only, not whole page) by andrewdodd13 on 04-21-2007 at 07:45 PM
Okay okay, you're going to want to use code similar to what MeEtc posted, but there's a bit of a problem see: code:. Then, you'd have (wherever you wanted the refresh button to go): <input type="submit" onClick="getimage(); return 0;" /> and use MeEtc's script to get image.php again. RE: Refresh Image Button Needed (refreshes image only, not whole page) by vaccination on 04-21-2007 at 07:48 PM He already has an 'image.php' RE: Refresh Image Button Needed (refreshes image only, not whole page) by andrewdodd13 on 04-21-2007 at 07:52 PM
No he doesn't... I know he already has a script which generates the random image (which is why I didn't provide code for that), but if you read my post slowly (which you might needa do, I tend to waffle ) it's because if you check the source for the page the actual URL to the image is sent to the browser, which would need to be changed somehow - the simplest way being AJAX, of course. RE: Refresh Image Button Needed (refreshes image only, not whole page) by MeEtc on 04-21-2007 at 07:59 PM my script above works fine, except that it loads the specified image from the cache, instead of re-downloading it. looks like you're gonna need to XMLHTTPRequest it RE: Refresh Image Button Needed (refreshes image only, not whole page) by vaccination on 04-21-2007 at 08:07 PM
quote: Blah my bad. Dodgy sam, I thought he had an 'image.php' type file RE: Refresh Image Button Needed (refreshes image only, not whole page) by prashker on 04-21-2007 at 08:12 PM
quote: I used too, now I am using some Nathan code to do it . (Because it had to be changed for the MySql Entries and Admin Panel =p. ./James/. says: why'd you change? SonicSam - New Account says: Because SonicSam - New Account says: when I got the Ubercool Admin panel SonicSam - New Account says: all the uploaded images are now added to a MySql Database ./James/. says: ohhh :: SonicSam - New Account says: which then I 'approve' or 'decline' ./James/. says: * SonicSam - New Account says: which then decides which ones are shown SonicSam - New Account says: if it was just a php file, all of them would be shown quote: Um, can you ? quote: Meaning ? RE: RE: Refresh Image Button Needed (refreshes image only, not whole page) by andrewdodd13 on 04-21-2007 at 08:52 PM
quote:XMLHTTPRequest is the object used by most browsers (except IE6 and below) to initialize an AJAX session. It rocks. I've included code in the file I sent you which works with all browsers.. RE: Refresh Image Button Needed (refreshes image only, not whole page) by prashker on 04-21-2007 at 08:55 PM
quote: . Thanks . I got the button added and it works perfectly with Jesuswasajew.info . Now it is a little better having the music flow when showing another image. Thanks Andrew . Reputation+1 . |