D
Diarmaid McGleenan
I have a javascript function called ShowActiveLink to which I pass a
full <a href="blah.htm"
onClick="javascript:newWindow('quotedStuff');"> link. (See below.)
---------------
<script language="javascript">void ShowActiveLink('<a
href="javascript:newWindow('http://www.vre.org/');"
target="_blank">VRE Service Status</a>');</script>
<a href="javascript:newWindow('http://www.vre.org/vremap/app?action=ovmap');"
target="_blank">VRE Service Status</a></li>
---------------
My problem is that I have no method of escaping the single quotes in
newWindow('') because the entire <a href> is placed there dynamically
by our content management system when the file is generated.
I've thought of
void ShowActiveLink(escape('<a href="javascript:newWindow('...')'));
but it doesn't work because of the single quotes contained within the
<a href>. I thought of using VBScript, but that doesn't work either
since the double quotes in the link cause the string to close too
early and the compiler blows up.
Keeping in mind that I can't manually escape the href, what can I do
now?
full <a href="blah.htm"
onClick="javascript:newWindow('quotedStuff');"> link. (See below.)
---------------
<script language="javascript">void ShowActiveLink('<a
href="javascript:newWindow('http://www.vre.org/');"
target="_blank">VRE Service Status</a>');</script>
<a href="javascript:newWindow('http://www.vre.org/vremap/app?action=ovmap');"
target="_blank">VRE Service Status</a></li>
---------------
My problem is that I have no method of escaping the single quotes in
newWindow('') because the entire <a href> is placed there dynamically
by our content management system when the file is generated.
I've thought of
void ShowActiveLink(escape('<a href="javascript:newWindow('...')'));
but it doesn't work because of the single quotes contained within the
<a href>. I thought of using VBScript, but that doesn't work either
since the double quotes in the link cause the string to close too
early and the compiler blows up.
Keeping in mind that I can't manually escape the href, what can I do
now?