Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ampersand in code failing W3C validation 1

Status
Not open for further replies.

clivehenderson

IS-IT--Management
Nov 2, 2002
66
GB
Hi
I use the code below for bookmarking a page and it works well

However it fails W3C validation checks on the line with opera with:
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Can anyone suggest a change to get round this please?
[highlight #FF99FF]
<script type="text/javascript">
function bookmark_us(url, title){

if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
[/highlight]

Any help appreciated
Thanks
Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top