On Sat, Oct 03, 2009 at 05:11:01PM -0400, Mark Eichin wrote:
> What I'm really trying to do is load jquery into an existing page, and
> then load my own code, so I can prototype/demo some improvements to a
> website I can't otherwise modify.
> 
> interactive("jquery-test",
>           "load and run a jquery file",
>           function(I) {
>               subscript_loader.loadSubScript("file://" +
> "/usr/share/javascript/jquery/jquery.js", I.buffer.document);
>               subscript_loader.loadSubScript("file://" + "/tmp/test.js", 
> I.buffer.document);
>           });
> 
> This definitely loads and runs jquery.js and test.js; if I put alert()
> calls in test.js they fire, but $() references in test.js fail with
> "ReferenceError: $ is not defined."  Actually, now that I look more
> closely jquery isn't just logging stylistic warnings, it's also
> reporting
> Console error: [JavaScript Warning: "reference to undefined property
> jQuery.cache[id][name]"
>   {file: "chrome://conkeror-modules/content/rc.js ->
> file:///home/eichin/.emacs.js ->
> file:///usr/share/javascript/jquery/jquery.js"
>   line: 679}]
>   Category: component javascript
> 
> Any suggestions?  Is I.buffer.document not the right target object?


  The method that I'm familiar with involves using the DOM to add
html:script elements to the document's head to load your js files.

-- 
John Foerch
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to