Created
September 8, 2017 10:46
-
-
Save LeonardoCiaccio/a63c07beed1b9203ff181827bbc93401 to your computer and use it in GitHub Desktop.
Rende un link sempre nuove quindi non restituisce la cache in una chiamata xhr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var _noCache = function( link ){ | |
| var newdata = Date.now(); | |
| if( link.indexOf( "?" ) > -1 ){ | |
| return link.replace( "?", "?" + newdata + "=" + newdata + "&" ); | |
| }else if( link.indexOf( "#" ) > -1 ){ | |
| return link.replace( "#", "?" + newdata + "=" + newdata + "#" ); | |
| } | |
| return link + "?" + newdata + "=" + newdata; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment