Jquery Function is saying not defined when running a php script

前端 未结 3 1433
悲&欢浪女
悲&欢浪女 2021-01-25 02:12

I am essentially making it so when you click on a button to \"vote up\"

at the moment i have

clients.php



        
3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-25 02:30

    You have scoped out the methods.

    Instead you can attach them to windows to be accessible from any place.

    window.voteUp  = function()
    {
        $.get("voteup.php");
        return false;
    }
    
    window.voteDown = function()
    {
        $.get("votedown.php");
        return false;
    }
    

提交回复
热议问题