Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jquery not working

John_Cho-OracleJan 19 2016 — edited Jan 19 2016

Hello, I have a question about jquery in OJET.

I have been trying to use JQuery in my OJET site, but for some reason i can't seem to execute a simple alert on a onclick. The below is a simple example. I'm not sure why i can't use Jquery, any help would be much appreciated.

html

<h1>People Content Area</h1>

    <div class="alert alert-info">Click "Parse" button.</div>

    <button class="btn" id="btnParse" title="Parse Tabs">Parse</button>

<div data-bind="text: something"></div>

my JS looks like this

define(['ojs/ojcore' ,'knockout', 'jquery'

   ], function(oj, ko) {

            function peopleContentViewModel() {

                var self = this;

                self.something = ko.observable("Hello World");

            }

           

      $(document).ready(function () {

         

$(function () {      

    $('#btnContainer').on('click', '#btnParse', function () { alert('clicked');});

});

  // bind each view model to a jQueryMobile page

  ko.applyBindings(peopleContentViewModel, document.getElementById("mainCol"));

});

});

This post has been answered by John_Cho-Oracle on Jan 19 2016
Jump to Answer
Comments
Post Details
Added on Jan 19 2016
5 comments
1,344 views