问题
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