missing ) after argument list

S

salimbouiche

Hi everybody,

i have the following error when trying to run a javascript function :
missing ) after argument list

The code is :

function addvideo(tag, youtubeid, duration, rating, thumbnail, title)
{
new Ajax.Updater($('aff_message'),"?
q=ajax_action&do=addvideo&tag="+tag+"&id="+youtubeid
+"&duration="+duration+"&rating="+rating+"&thumbnail="+thumbnail
+"&title="+title+"",{method: 'get'});
}

The function is called in that way in HTML source code:

<a href="javascript:addvideo(\'jamel\', \'lm2l7L5IAfw\', \'1366\',
\'4\', \'http://img.youtube.com/vi/lm2l7L5IAfw/2.jpg\', \'Jamel
Debbouze\');">Update</a>


Does someone can help me please ...??

Thanks in advance,

Salim
 
W

wisestpotato

Hi everybody,

i have the following error when trying to run a javascript function :
missing ) after argument list

I think your problem may be that you are escaping the single quotes
within the href attribute. They shouldn't be escaped, as by doing so
you render the argument list meaningless. Try this instead:

<a href="javascript:addvideo('jamel', 'lm2l7L5IAfw', '1366', '4',
'http://img.youtube.com/vi/lm2l7L5IAfw/2.jpg', 'Jamel
Debbouze');">Update</a>

regards,

wp.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top