How can I check for a specific HTML tag or Text and remove it when the page loads

Discussion in 'Javascript' started by techy techno, Jan 25, 2004.

  1. techy techno

    techy techno Guest

    hiii

    I wanted to know how can I check for a specific HTML tag or user defined
    TEXT and delete it when the page loads

    Whenver the IE loads the page my company add its COMPANY NAME in my
    office on any page so what I want to do is to check for my company name
    b4 the page loads and remove the company name and then load the page.

    I want to do this in JS


    thanks

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    techy techno, Jan 25, 2004
    #1
    1. Advertising

  2. techy techno

    Randy Webb Guest

    Re: How can I check for a specific HTML tag or Text and remove itwhen the page loads

    techy techno wrote:

    > I wanted to know how can I check for a specific HTML tag or user defined
    > TEXT and delete it when the page loads
    > Whenver the IE loads the page my company add its COMPANY NAME in my
    > office on any page so what I want to do is to check for my company name
    > b4 the page loads and remove the company name and then load the page.


    Sounds more like you want to remove an Ad Banner from a site.

    > I want to do this in JS


    And if JS is disabled?



    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Randy Webb, Jan 25, 2004
    #2
    1. Advertising

  3. techy techno

    Fabian Guest

    techy techno hu kiteb:

    > hiii
    >
    > I wanted to know how can I check for a specific HTML tag or user
    > defined TEXT and delete it when the page loads


    this sounds like a job for proxomitron. Google for it. Of course, since
    you appear to be using a company machine, I'm not sure whetehr you'd
    have permission to install any programs.

    > Whenver the IE loads the page my company add its COMPANY NAME in my
    > office on any page so what I want to do is to check for my company
    > name b4 the page loads and remove the company name and then load the
    > page.


    If you are using a company machine, I think the company has the right to
    impose whatever banners it sees fit. Is there a particular reason you
    don't want these to appear?


    > I want to do this in JS


    I don't think you can. I could be wrong of course.


    --
    --
    Fabian
    This post is not associated in any way with forum4designers dot com.
    Permission is specifically denied for that website to archive this post
    or display it in any way.
     
    Fabian, Jan 25, 2004
    #3
  4. techy techno

    techy techno Guest

    ITs ok

    I just need the JS for hiding the TEXT

    ITs not a banner its just a <h1> link to their site and If the js is
    disabled then thats my hardluck :

    so please can you give me the required JS.
    thanks

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    techy techno, Jan 25, 2004
    #4
  5. On 25 Jan 2004 09:19:10 GMT, techy techno <> wrote:

    > I just need the JS for hiding the TEXT
    >
    > ITs not a banner its just a <h1> link to their site and If the js is
    > disabled then thats my hardluck :
    >
    > so please can you give me the required JS.


    Use CSS instead. It has more chance of being supported, too.

    If the inserted HTML has a specific pattern, you can match that with CSS
    selectors. For example:

    <style type="text/css">
    h1 a {
    display: none;
    }
    </style>
    </head>

    <body>
    ...
    <h1><a href="...">The advert text</a></h1>

    The CSS rule above will cause all links within a H1 element to be hidden.
    They'll still exist in the page, but the user won't see them. Of course,
    this means that you cannot use a similar sequence yourself. However, you
    needed to, the above example could be modified to:

    <style type="text/css">
    h1 a {
    display: none;
    }
    h1.showThis a {
    display: inline;
    }
    </style>
    </head>

    <body>
    ...
    <h1><a href="...">The advert text</a></h1>
    ...
    <h1 class="showThis"><a href="...">My own link</a></h1>

    The use of a more specific selector, acheived through the use of a class,
    takes precedence, so the second link is displayed, whilst the first is
    hidden.

    If this is to hide banner images or text inserted by a host, be warned
    that hiding that content probably violates the Terms and Conditions of
    that site and can lead to the termination of your account.

    Mike

    --
    Michael Winter
    d (replace ".invalid" with ".uk" to reply)
     
    Michael Winter, Jan 25, 2004
    #5
    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. shruds
    Replies:
    1
    Views:
    933
    John C. Bollinger
    Jan 27, 2006
  2. Silver
    Replies:
    14
    Views:
    983
    Evertjan.
    Jun 21, 2006
  3. Replies:
    1
    Views:
    422
    Andrew Thompson
    Nov 29, 2006
  4. afrinspray
    Replies:
    2
    Views:
    147
    afrinspray
    Sep 7, 2006
  5. Roy Smith
    Replies:
    1
    Views:
    579
    Terry Reedy
    Jun 27, 2012
Loading...

Share This Page