chrome apps- content security policy - jquery datepicker() not working

被刻印的时光 ゝ 提交于 2019-12-24 13:15:07

问题


i tried this :

    <div id="d1"> sampletext </div>
    $("#d1").datepicker();

when i run above code, it is showing datepicker , but without any formatting like good background and others, why ? Also , after i click on any date in the date picker, getting the error

Refused to execute inline event handler because of Content-Security-Policy.

what should i do to make this work ? or, if there is any solution that i can use without using this datepicker, plz tell me so that i will use it , thanks !


回答1:


There is a simple solution: use jQuery UI 1.8.22 or newer.

They finally fixed datepicker to not use inline javascript any more (a 4 year old bug ticket - http://bugs.jqueryui.com/ticket/3945), solving problems with Adobe AIR, MSIE in intranet, and, yes - Chrome extensions with v2 manifest.



来源:https://stackoverflow.com/questions/10800674/chrome-apps-content-security-policy-jquery-datepicker-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!