Hello everyone, I ask for help, here is the script:
var article = { delete: function (id) { $.post('?action=admin', { act: 'delete', aid: id }, function (a) { alert(a); }) }, edit: { now: function (id) {.......... }, withadmin: function (id) { window.location = '?action=admin&act=article_edit&id=' + id; } } } The <script></script> works, but if I write onclick="article.edit.now('1');" nothing works, why?
If I write this:
<script> $('#edit_news').click(function () { article.edit.now('1'); }); </script> Works if I write
<a href="" onlick='article.edit.now('1')'>Редактировать</a> Does not work.