[advanced search]
Results from the most recent live auction are here.
9 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 04-01-2008, 02:22 PM   · #1
newsiness
Senior Member
 
Trader Rating: (41)
Join Date: Jul 2005
Posts: 1,220
NP$: 238.50 (Donate)
newsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to behold
AIDS/HIV Save a Life
No Cached Image

Everything works fine except that when a new image is uploaded to replace an existing one, the browser still displays the former one until i refresh the page.

By using this piece of PHP, the browser thinks its a new image and reloads.
Code:
<img src="img.jpg?rand=<?=rand(1,1000);?>" />


Anyway to complete the same task in Javascript instead of PHP?

Thanks in advance!!!


Please register or log-in into NamePros to hide ads
__________________
nothing here!!!

Last edited by newsiness : 04-01-2008 at 02:25 PM.
newsiness is online now   Reply With Quote
Old 04-01-2008, 06:40 PM   · #2
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 
Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,239
NP$: 409.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Code:
<script language="javascript"> document.write('<img src="img.jpg' + Math.ceil(Math.random() * 10000) + '" />'); </script>

Something like that.
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.2 now available!!
MetaCreator.com - Free Meta Tag Creator
CodingPlanet.com - Coming soon...
SecondVersion is offline   Reply With Quote
Old 04-02-2008, 03:35 AM   · #3
xrvel
xrvel is cruel :-)
 
xrvel's Avatar
 
Name: Kurniawan
Location: Indonesia
Trader Rating: (29)
Join Date: Nov 2007
Posts: 1,001
NP$: 1169.18 (Donate)
xrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to beholdxrvel is a splendid one to behold
Its based on Eric's explanation

Code:
<script type="text/javascript"> function refreshImage(imageId) { var objImage = document.getElementById(imageId); var oldSrc = objImage.src; var cleanSrc = oldSrc.substr(0, oldSrc.indexOf('?')); var newSrc = cleanSrc + "?" + Math.ceil(Math.random() * 10000); //alert(newSrc); objImage.src = newSrc; } </script> <!-- Put at least one ? here --> <img src="yours.jpg?" id="your-image" /> <input type="button" value="refresh" onclick="refreshImage('your-image')" />
__________________
Xrvel Love Domains TraceNic
xrvel is offline   Reply With Quote
Old 04-03-2008, 02:00 PM   · #4
newsiness
Senior Member
 
Trader Rating: (41)
Join Date: Jul 2005
Posts: 1,220
NP$: 238.50 (Donate)
newsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to beholdnewsiness is a splendid one to behold
AIDS/HIV Save a Life
Thanks Guys!!!
Rep Added.
__________________
nothing here!!!
newsiness is online now   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Traffic Down Under EscrowDNS EscrowDNS
Advertise your business at NamePros
All times are GMT -7. The time now is 04:01 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0