Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How can I check for a specific HTML tag or Text and remove it when the page loads

Reply
Thread Tools

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

 
 
techy techno
Guest
Posts: n/a
 
      01-25-2004


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!
 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      01-25-2004
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/

 
Reply With Quote
 
 
 
 
Fabian
Guest
Posts: n/a
 
      01-25-2004
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.

 
Reply With Quote
 
techy techno
Guest
Posts: n/a
 
      01-25-2004


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!
 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      01-25-2004
On 25 Jan 2004 09:19:10 GMT, techy techno <(E-Mail Removed)> 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
http://www.velocityreviews.com/forums/(E-Mail Removed)d (replace ".invalid" with ".uk" to reply)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
HTML.Tag.BASE same as HTML.Tag.A carlbernardi@gmail.com Java 1 11-29-2006 03:41 AM
Best way to remove body/html tag from HTML::Element tree afrinspray Perl Misc 2 09-07-2006 04:55 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
How do you make sure a frameset is loaded? I'm trying to open a frameset in a new window which shows a specific html page in a specific frame ck388 Javascript 1 09-24-2003 08:32 PM



Advertisments