Forum Moderators: open
I've got this 'add to favourites' JavaScript problem. The code below looks like a nightmare initially, but the error I get is ')' is expected, and I've tried to solve this but my JavaScript skills is not best.
Can anyone shed some light on this?
function bookIt(argVal)
{
var bookData = new Array();
bookData = argVal.split("¦");
if (document.all)
{
window.external.AddFavorite(bookData[0], bookData[1]);
}
else
{
alert("Netscape users will need to bookmark this site manually using the keyboard shortcut <Ctrl-D>.");
}
}
This is where code falls down.
<a href="#" onclick="bookIt('javascript:d=document;t=getSelection();void(mark=window.open('http://www.domain.com/save.php?a='+escape(d.title)+'&b='+escape(d.location.href)+'&c='+escape(t)+'&d='+escape(d.lastModified)+'&e='+escape(d.referrer)+'&f='+escape(d.domain),'mark','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=y es'));mark.focus();'); return false;">add this site to your favourites</a>
Many Thanks :o)
<a href="#" onclick="bookIt('javascript:d=document;t=getSelection();void(mark=window.open(\'http://www.domain.com/save.php?a='+escape(d.title)+'&b='+escape(d.location.href)+'&c='+escape(t)+'&d='+escape(d.lastModified)+'&e='+escape(d.referrer)+'&f='+escape(d.domain),\'mark\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));mark.focus();'); return false;">add this site to your favourites</a>
Still got the same problem, I'm afriad.
Here's the code again
its says char 254.
<a href="#" onclick="bookIt('javascript:d=document;t=getSelection();void(mark=window.open(\'http://www.domain.com/save.php?a='+escape(d.title)+'&b='+escape(d.location.href)+'&c='+escape(t)+'&d='+escape(d.lastModified)+'&e='+escape(d.referrer)+'&f='+escape(d.domain),\'mark\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));mark.focus()'); return false;">add this site to your favourites</a>
Any ideas?
Thanks