change link colors from JavaScript?

Discussion in 'Javascript' started by mike, Jan 26, 2005.

  1. mike

    mike Guest

    I'm writing a FireFox extension and I have the dom and therefor the
    links[] collection

    window.getBrowser().contentDocument.links

    Is there a way to change the color of these links based on the stuff I'm
    checking for from the JavaScript?

    For example. If I have this loop
    var number_of_links = window.getBrowser().contentDocument.links.length;

    for (var i=0; i < number_of_links; i++)
    {
    var domain = window.getBrowser().contentDocument.links.hostname;
    //Check hostname here and change color
    }

    how could I change the links color?

    thanks
    mike
     
    mike, Jan 26, 2005
    #1
    1. Advertising

  2. mike

    Fred Oz Guest

    mike wrote:
    > I'm writing a FireFox extension and I have the dom and therefor the
    > links[] collection
    >
    > window.getBrowser().contentDocument.links
    >
    > Is there a way to change the color of these links based on the stuff I'm
    > checking for from the JavaScript?
    >
    > For example. If I have this loop
    > var number_of_links = window.getBrowser().contentDocument.links.length;
    >
    > for (var i=0; i < number_of_links; i++)
    > {
    > var domain = window.getBrowser().contentDocument.links.hostname;
    > //Check hostname here and change color
    > }
    >
    > how could I change the links color?
    >


    Whilst this is a general ECMA/JavaScript/JScript news group, I
    think Firefox extensions are a little outside the knowledge of
    most posters here.

    You may get quicker/better help here:

    <URL:http://forums.mozillazine.org/viewforum.php?f=19>

    --
    Fred
     
    Fred Oz, Jan 26, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    949
    Kevin Spencer
    May 17, 2005
  2. Brian

    Link colors

    Brian, Jul 21, 2005, in forum: HTML
    Replies:
    14
    Views:
    923
    Noozer
    Jul 22, 2005
  3. Woodmon
    Replies:
    20
    Views:
    16,870
    Toby Inkster
    Oct 22, 2005
  4. AAaron123

    TreeNode colors come from anchor colors

    AAaron123, Aug 7, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    562
    darrel
    Aug 7, 2008
  5. ZelluX
    Replies:
    3
    Views:
    1,960
    Peter Otten
    Dec 1, 2008
Loading...

Share This Page