1

I have a requirement of inserting following jquery code on click of an extension

var klo=$(".dijitAccordionTitle.dijitAccordionTitle-selected").parent().siblings().css("display","none")
$('#containerDiv').show().parentsUntil('body').andSelf().siblings().hide();
$("#dijit_layout_AccordionContainer_0").height($(document).height())

Similar concept is explained in "Programmatic injection" of http://developer.chrome.com/extensions/content_scripts.html.My issue is that i want to run jquery code instead of plain javascript code. Thanks

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
user2513420
  • 93
  • 2
  • 7
  • 1
    You have to inject both jQuery and your custom code then. However, since your jQuery code isn't very complicated maybe it will be easier to simply rewrite it in vanilla JS? – Konrad Dzwinel Aug 14 '13 at 07:07
  • Yes i agree this code is not complicated but its thoroughly tested.Writing it in plain vanilla will again take time:) – user2513420 Aug 14 '13 at 07:55
  • As Konrad said, why don't you just add jQuery to your extension and to the list of content scripts? – Timothée Boucher Aug 15 '13 at 05:51
  • possible duplicate of [Google Chrome Extensions: How to include jQuery in programatically injected content script?](http://stackoverflow.com/questions/4698118/google-chrome-extensions-how-to-include-jquery-in-programatically-injected-cont) – Paul Sweatte Sep 11 '13 at 18:00

0 Answers0