Advertisement:

Bookmarksite Script error

Aloittaja edi67, kesäkuu 08, 2008, 06:46:53 AP

« edellinen - seuraava »

edi67

I have one problem i want add script for bookmarksite so i insert this before code HEAD:

<script type="text/javascript">

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

</script>


and after i add the comand everywhere i want in template :

<a href="javascript:bookmarksite('CrazyZone', 'http://ediboardlatervista.org')">Add to Favorites</a>

Problem is the caratter ' show me error in my template:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /membri/ediboard/Themes/default/index.template.php on line 517


i dont understand in many site work but in my site not work the CARATTER '

some solution ?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

vbgamer45

You need to escape the '

Find

<a href="javascript:bookmarksite('CrazyZone', 'http://ediboardlatervista.org')">Add to Favorites</a>

Change to

<a href="javascript:bookmarksite(\'CrazyZone\', \'http://ediboardlatervista.org\')">Add to Favorites</a>
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

edi67

excellent, work like a chamr now thx ;)
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Advertisement: