Here's the fail I'm having -- the 'sitePath' is a javascript variable at global file scope:
<link rel="stylesheet" type="text/css"
href="javascript:getJval('sitePath')/rb_UI_styles.css" />
Here is getJval():
function getJval(theVal)
{
return theVal;
}
Originally I tried this but it didn't work:
<link rel="stylesheet" type="text/css"
href="javascript:sitePath/rb_UI_styles.css" />
I read a bunch of SO posts, including this one, many of these posts I've read have an 'href' that gets set by using the
href="javascript:someFunc(someparam)"
syntax.
However, this syntax to call a javascript function to set an 'href' is not working for me in the href for pulling in a stylesheet:
<link rel="stylesheet" type="text/css"
href="javascript:getJval('sitePath')/rb_UI_styles.css" />
Can't figure out why. I know the stylesheet can be pulled in because if I replace the above with the actual URL to the CSS file, the styles appear successfully on the web page.
Does this javascript:function() syntax not work to set an href in a stylesheet link, for some reason?