What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Refresh Image Button Needed (refreshes image only, not whole page) [fixed]

Pages: (2): « First « 1 [ 2 ] Last »
Refresh Image Button Needed (refreshes image only, not whole page) [fixed]
Author: Message:
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Refresh Image Button Needed (refreshes image only, not whole page)
frames are evil
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
04-21-2007 07:37 PM
Profile PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Refresh Image Button Needed (refreshes image only, not whole page)
quote:
Originally posted by andrewdodd13
You could always use... *cough* frames *cough*. :P

Yes I know I could, but I dont want to :p.
04-21-2007 07:38 PM
Profile PM Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
Okay okay, you're going to want to use code similar to what MeEtc posted, but there's a bit of a problem see:

<body style="backgroundImage = 'url(image.jpg)'">

For that to work properly, you'd need to supply the page with a list of images, or supply a way of using AJAX to retrieve the location of another image.

It'd be simpler to have a file image.php which gives you the random image. So it'd be backgroundImage = 'url(image.php)'. And image.php would be like

code:
// generate location to random image
header ("Location: <pathtorandomimage>");

.

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.
[Image: AndrewsStyle.png]
04-21-2007 07:45 PM
Profile E-Mail PM Web Find Quote Report
vaccination
Veteran Member
*****

Avatar

Posts: 2513
Reputation: 43
32 / Male / –
Joined: Apr 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
He already has an 'image.php'
[Image: jumbled.png]
04-21-2007 07:48 PM
Profile PM Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
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 :P) 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.

If you want a full AJAX implementation, I'm sure I could rustle up code for that.
[Image: AndrewsStyle.png]
04-21-2007 07:52 PM
Profile E-Mail PM Web Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Refresh Image Button Needed (refreshes image only, not whole page)
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
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
04-21-2007 07:59 PM
Profile PM Web Find Quote Report
vaccination
Veteran Member
*****

Avatar

Posts: 2513
Reputation: 43
32 / Male / –
Joined: Apr 2005
RE: Refresh Image Button Needed (refreshes image only, not whole page)
quote:
Originally posted by andrewdodd13
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 :P) 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.

If you want a full AJAX implementation, I'm sure I could rustle up code for that.

Blah my bad. Dodgy sam, I thought he had an 'image.php' type file :P
[Image: jumbled.png]
04-21-2007 08:07 PM
Profile PM Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Refresh Image Button Needed (refreshes image only, not whole page)
quote:
Originally posted by vaccination
He already has an 'image.php'

I used too, now I am using some Nathan code to do it :p. (Because it had to be changed for the MySql Entries and Admin Panel =p.

./James/. says:
why'd you change? :P
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 :P
./James/. says:
ohhh ::
SonicSam - New Account says:
which then I 'approve' or 'decline'
./James/. says:
:P*
SonicSam - New Account says:
which then decides which ones are shown :P
SonicSam - New Account says:
if it was just a php file, all of them would be shown
quote:
Originally posted by andrewdodd13
If you want a full AJAX implementation, I'm sure I could rustle up code for that.

Um, can you (a)?

quote:
Originally posted by MeEtc
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

Meaning :p?
04-21-2007 08:12 PM
Profile PM Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
RE: RE: Refresh Image Button Needed (refreshes image only, not whole page)
quote:
Originally posted by SonicSam
quote:
Originally posted by MeEtc
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

Meaning :p?

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..
[Image: AndrewsStyle.png]
04-21-2007 08:52 PM
Profile E-Mail PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Refresh Image Button Needed (refreshes image only, not whole page)
quote:
Originally posted by andrewdodd13
I've included code in the file I sent you which works with all browsers..

:D.

Thanks :D.

I got the button added and it works perfectly with Jesuswasajew.info :D.

Now it is a little better having the music flow when showing another image.

Thanks Andrew :). Reputation+1 :o.
04-21-2007 08:55 PM
Profile PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On