铬应用程序内容安全策略 - jquery datepicker()不起作用 [英] chrome apps- content security policy - jquery datepicker() not working

查看:77
本文介绍了铬应用程序内容安全策略 - jquery datepicker()不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过这个:

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

当我运行上面的代码时,它显示了datepicker,但没有任何格式化,为什么?
此外,我点击日期选择器中的任何日期后,获取错误

 拒绝执行内联事件处理程序由于内容安全策略。 

我该怎么做才能做到这一点?或者,如果有任何解决方案,我可以使用不使用此日期选择器,请告诉我,这样我就会使用它,谢谢!

有一个简单的解决方案:使用jQuery UI 1.8.22或更新

他们最终修复了datepicker不使用内联javascript更多(一个4岁的bug票 - http://bugs.jqueryui.com/ticket/3945),解决与Adobe AIR,Intranet中的MSIE相关的问题,以及是 - 带有v2清单的Chrome扩展。


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 !

解决方案

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.

这篇关于铬应用程序内容安全策略 - jquery datepicker()不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆