That's expected behaviour when using content security policy. Default CSP doesn't allow "unsafe inline" functions (which includes onclick=), since these can often be injected by attackers using cross-site scripting.
The usual way to avoid this is to use addEventListener instead. There's a worked example for converting onclick to something CSP-friendly here: https://developer.chrome.com/extensions/contentSecurityPolicy Under the section header "Inline JavaScript will not be executed." On Wed, Dec 10, 2014 at 1:46 PM, McGee, Art <[email protected]> wrote: > Refused to execute inline event handler because it violates the following > Content Security Policy directive: "script-src 'self'". Either the > 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is > required to enable inline execution. > > I get this message when I click the icon below. > > <img id="settingsIcon" onclick="$('#settingsPage').toggleClass('hidden');" > src="./DNA_common/images/icongear.png" width="117px" height="117px"> > > with the following html on the page. > > <div id="settingsPage" class="tabs pageBgColorNormalTransparent > settingsPage hidden"> > <div id="tabsTopPanel" class="tabsTopPanel"> > <div class="tabsTopPanelTitle"> > <div class="boxIconRectangleSmall bgColorTheme"></div> > <div class="boxIconCaptionSmall boxCaptionText">APPS</div> > </div> > > <div class="tabsCloseButton" onclick="$('#settingsPage').toggle();"></div> > > <div id="tabsTabsID" class="tabsTabs"> > <div onclick="$('#settingsTabs').tabs('tabsTabClick',0);" id="tabsTab0" > class="tabsTab tabsTabSelected fontSizeLarger fontWeightBold > fontColorNormal fontColorSelected">SETTINGS</div> > <div class="tabsTabClear"></div> > </div> > </div> > <!-- add class 'hidden' to this id tabsTopSubPanel, when component is > displayed --> > <div id="tabsTopSubPanel" class="tabsTopSubPanel"> > <div id="tabsContent" class="tabsContent settingsContent"> > <ul id="settingsPageList" class="fontSizeLarge fontWeightBold > fontColorNormal"> > </ul> > </div> > </div> > </div> > > > -- > *Art McGee* > Infotainment Engineer > > > > Jaguar Land Rover North America, LLC > 1419 NW 14th Ave, Portland, Oregon, 97209 > JaguarUSA.com <http://www.jaguarusa.com/index.html> | LandRoverUSA.com > <http://www.landrover.com/us/en/lr/> > > > _______________________________________________ > Dev mailing list > [email protected] > https://lists.tizen.org/listinfo/dev > >
_______________________________________________ Dev mailing list [email protected] https://lists.tizen.org/listinfo/dev
