Ignore javascript syntax errors in a page and continue executing the script

前端 未结 11 897
日久生厌
日久生厌 2020-12-02 18:21

I develop plugins for WordPress. It uses some jquery in the user side (themes) as a jquery plugin. The problem is, when there is an javascript error with other plugins made

11条回答
  •  一向
    一向 (楼主)
    2020-12-02 18:43

    This is worked for me:

    try{
        //your code
    }
    catch(error)
    {
        return true;
    }
    

提交回复
热议问题