Hi..am just getting used to regex..but am unsure of how to use javascript variables within the regular expressions..
For example...as it stands..my code reads..
if (window.location.hostname == 'localhost') {
var $sURLDomain = 'http://localhost/';
}
else {
var $sURLDomain = 'http://mysite.com';
}
$('#content a[href^=$sURLDomain]').addClass('internal');
Essentially i am setting the variable $sURLDomain dependant on whether im am on my local or live url.
I then want to test whether my links start with the $sURLDomain variable...and use Jquery to add a class to those specific links only....
This doesnt seem to be functioning, so am unsure of how to achieve this..
Any help would be appreciated...