Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 05-10-2011, 10:33 AM Cachebuster
mgravlee's Avatar
Experienced Talker

Posts: 35
Trades: 0
Can anybody help me with a Java script that will replace the [CACHEBUSTER] below with a random number in a html page?

http://adfarm.mediaplex.com/ad/bn/0-0-0-0?mpt=[CACHEBUSTER]
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
mgravlee is offline
Reply With Quote
View Public Profile Visit mgravlee's homepage!
 
 
Register now for full access!
Old 05-10-2011, 11:24 AM Re: Cachebuster
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
To what end???


javascript runs AFTER the page has been cached by the browser.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-10-2011, 03:35 PM Re: Cachebuster
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Quote:
Originally Posted by mgravlee View Post
Can anybody help me with a Java script that will replace the [CACHEBUSTER] below with a random number in a html page?

http://adfarm.mediaplex.com/ad/bn/0-0-0-0?mpt=[CACHEBUSTER]
You could try something like: ( havent tested )

Code:
<script language="javascript" type="text/javascript">
<!--

var nocache = Math.random();
document.write('<a href="http://adfarm.mediaplex.com/ad/bn/0-0-0-0?mpt= ' + nocache + '">Link</a>');


//-->
</script>
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE



Last edited by lynxus; 05-10-2011 at 03:36 PM..
lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 05-31-2011, 07:57 AM Re: Cachebuster
c69
c69's Avatar
Experienced Talker

Posts: 40
Name: Constantine
Trades: 0
its not random, but its unique* per user, and it works for the "**** cached ajax response" and similar issues:
Code:
var link = "_ttp://adfarm.mediaplex.com/ad/bn/0-0-0-0?mpt=" + (new Date).getTime();

* - its current time in milliseconds, if you will need more randomness, add Math.random() to that, but in 99.9% cases you wont.
c69 is offline
Reply With Quote
View Public Profile Visit c69's homepage!
 
Reply     « Reply to Cachebuster
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.38440 seconds with 12 queries