Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

javascript in Extension event not firing

$
0
0
I am trying to get the "week" input control working in my Extension popup.js file. Here is the def


    <label for="week">What week?</label>
    <input id="week" type="week" name="week" value="2017-W01" onchange="set_theweek()">



In my popup.js file I have a function:

    //sets the week control to this week 
    function set_theweek()
    {
   var currentTime = new Date();      <<breakpoint on this line
   var week=getWeek(currentTime);
   } 

I can display the week "picker" fine. When I change the date in "week", I thought that set_theweek() would execute, but it doesn't. I have a breakpoint that never fires. All the examples of using "week" seems to POST to the backend. In my case, since this is an Extension, I can't do that. I just want to find out what week the user set the control to. Any ideas why my callback isn't working?

I also tried changing the event in the html file to oninput.  I am getting the following error:

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

What does this mean?

Viewing all articles
Browse latest Browse all 14348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>