On Tue, Dec 22, 2009 at 11:57 AM, Schalk Neethling
<[email protected]> wrote:
> For testing purposes I basically have a popup.html defined in my
> Manifest and then have the following in my background.html:
>
> <html>
> <head>
> <script src="jquery.min.js" type="text/javascript"></script>
>
> <script>
> $("p").css({'background-color': 'yellow'});
> </script>
>
> </head>
> </html>
>
> In my popup I do have a little Hello World paragraph but on loading the
> extension and clicking on the icon the popup pops with the paragraph but
> the background color does not change :(
>
> Am I going about this the wrong way? I have tried adding the:
>
> <script>
> $("p").css({'background-color': 'yellow'});
> </script>
>
> to the popup.html but with no success.

Hey Schalk, you'll have to include jQuery in your popup file to
reference the library there. Extension components don't automatically
have access to a background page's JavaScript objects.

Also, you might find it easier to load jQuery remotely rather than
bundling it with your extension. For example, the Google AJAX
Libraries API provides a convenient way to do so:

<script
  type="text/javascript"
  src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";>
</script>

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to