简体   繁体   中英

does jQuery work in Chrome Packaged Apps?

I'm using some javascript or jQuery code to hide and show different divs in my application using a navigation bar. it works beautifully in the browsers (Safari, Chrome, Firefox), but when I run it as it's own window as a chrome app it's all messed up. Click a nav item jumps me down the page to a div rather than hiding the current one and showing the selected one in its place.

Here's the jQuery code i'm using, any ideas why it wouldn't work the same? Or does jQuery not work in Chrome applications as separate windwos from the browser?

Thanks, as always.

$(document).ready(function(){

    $('#Notes').show().addClass('navActive');
    $('#Callers').hide();
    $('#Assignments').hide();
    $('#CallHist').hide();

    $('#lowersectionmenu a').click(function() {

    $('.navActive').hide().removeClass('navActive');

    var hrefid = $(this).attr('href')
    console.log(hrefid);
    $(hrefid).show().addClass('navActive');


    return false;  

    });

Again, a bit of searching and re-reading have answered my question.

  1. Yes jQuery will work with Chrome packaged Apps (or at least I think they will, I'll find out later).
  2. The issue appears to be that I'm referring to jQuery using a url reference to the web...this isn't allowed for packaged chrome apps / extensions.
  3. I should download the jQuery library I want, and then store it locally and refer to it locally. Then my code should work as id does in the browser.

Hope this might help out some one else at some point.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM