I want to add css file reference dynamically by onclick, which works fine now, but there is always a common css file being referenced multiple times, so I want to add a conditional branch, and also the url is absolute, which was intended to be modified to be relative.
The common css file name would always be a.css, could be in diff urls, so my plan is using Regex.
if (cssRef != /.*a.css$/){then add the css reference}
. anychar(url sign "/" would also match this I suppose)
* the previous char any time
$ end of the string
which is not working.
so, plz?
Aucun commentaire:
Enregistrer un commentaire