Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is better - javascript:functionName() or just functionName()? [duplicate]

Tags:

javascript

Possible Duplicate:
Do you ever need to specify javascript: in an onclick?

What is better to write in MVC3 when on the onclick event for example we call function with functionName()? javascript:functionName() or just functionName()?

like image 443
Unknown Avatar asked Mar 12 '26 23:03

Unknown


1 Answers

Actually the best is to not mix javascript and markup. So you could attach this onclick event handler unobtrusively using javascript in a separate file. But as far as your question is concerned, you don't need the javascript: prefix.

like image 84
Darin Dimitrov Avatar answered Mar 14 '26 12:03

Darin Dimitrov