+ Start a Discussion
Priya KPriya K 

SyntaxError: Unexpected token : Action Function

Hi,

I am getting error  in browser console as "SyntaxError: Unexpected token :", and my action function is not getting called?

What could be the reason?
Best Answer chosen by Priya K
AshishkAshishk
If apex:param tag donot have the "Name" attribute, you may get this error and actionfunction call will fail. Try adding name in param tag, it should work. 

If we donot add name attribute, salesforce will add param name dynamically containing ":" and javascript will fail.

All Answers

Priya KPriya K
If I remove parameter from action function it works, if I keep it. I am getting this error.
AshishkAshishk
If apex:param tag donot have the "Name" attribute, you may get this error and actionfunction call will fail. Try adding name in param tag, it should work. 

If we donot add name attribute, salesforce will add param name dynamically containing ":" and javascript will fail.
This was selected as the best answer