I have small problem out here and i guess it is quiet simple.
<a id="e2" href="/test/09111/520/123.pdf" target="fmContent" class="udrlinesmall" name="Table of Contents" onclick="javascript:jsTitle('Test Manual - What's New in This Guide');">
jsTitle function needs to sets the page title
<script>
function jsTitle(sTitle)
{
window.parent.document.title = sTitle;
}
</script>
Here the poblem is that i/p parameter to jsTitle has a single quote,so how do we espace that so that ' appears in the title
as well as it should not give javascript error.
One more thing is that i have many hyperlinks in the page
which can again have the single quote in the title.
onclick="javascript:jsTitle('Test Manual - What\\'s New in This Guide');"
Dave
That might work, but only because the browser you are using is ignoring the error. But MSIE hasn't taken over yet. That should be:
onclick="jsTitle('Test Manual - What\\'s New in This Guide');"
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
You will find, if you read through the backlog of postings, that Dave is only really interested in pages working in MSIE. And as far as JavaScript is concerned, there is something to be said for that but there are hundreds of different browsers out there.
We've had this argument before and yes, my only argument is that it is wrong. Yes it works on most browsers that I know about and it certainly works on most browsers out there, but it's still wrong.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Bookmarks