jquery issues - it wont change it accordingly
- by chuck
My coding isnt linking properly , its meant to use jquery to detect the OS and change the link accordingly , however it isn't.
In my HTML page I have it linked in the header as
<script src="jsquery.js" type="text/javascript"></script>
which loads up my jsquery now
$(document).ready(function() {
if (navigator.appVersion.indexOf("Win") != -1) {
// Computers runs windows
$("a[href$='.pdf']").each(function() {
this.href = this.href.replace("Volumes", "KP01DS0194TG");
});
}
if (navigator.appVersion.indexOf("Mac") != -1) {
// computer is a Mac
$("a[href$='.pdf']").each(function() {
this.href = this.href.replace("KP01DS0194TG", "Volumes");
});
}
});
Yet on Mac's it still tries to connect to KP01DS0194TG and not to Volumes - it doesnt change it - how can I get it to recognize the OS and change it accordingly?