diff --git a/js/cs.js b/js/cs.js index 52966ba..e927916 100644 --- a/js/cs.js +++ b/js/cs.js @@ -30,19 +30,19 @@ jQuery(document).ready(function($) { base = hrefExploded[2] - //console.log('checking to see if it might be a file...') last = hrefExploded[hrefExploded.length-1] || '' var lastExploded = last.split('.') - - if (lastExploded[1]){ + var lastValue = lastExploded[lastExploded.length-1] + + if (lastValue){ //console.log('ok, so there was a dot in the last value of the url.') $.each(extensions, function(index, value){ - if (value == lastExploded[1]){ + if (value == lastValue){ flag = $('') //console.log('match!') - ext = lastExploded[1] + ext = lastValue //console.log('ext:'+ext) flag.append('.'+ext) }