Avatar of eaweb
eaweb
Flag for undefined asked on

replace text and its hyperlink in a table

hi

i have attached table view being displayed from a source in a webpage. at the bottom of the table is a text that indicates disclaimer (it has its hyperlinks). i need to remove the text and its hyperlink for the following html formatted text:

<div style=text-align:right; border:none><FONT FACE=Arial SIZE=1 COLOR=000000>Quotes delayed at least 15 minutes. Market data provided by Interactive Data.</FONT></div>

how can i do this in javascript or ajax and have it working in IE, Firefox and chrome.
inv.jpg
JavaScriptAJAX

Avatar of undefined
Last Comment
eaweb

8/22/2022 - Mon
eaweb

ASKER
i am testing below ajax code but it doesn't work 100 percent.

using (jquery-1.7.1.min.js)

$(document).ready(function() {
      $(":contains('disclaimer'):last", "table").parents("td:first").html("<div style=text-align:right; border:none><FONT FACE=Arial SIZE=1 COLOR=000000>Quotes delayed at least 15 minutes. Market data provided by Interactive Data.</FONT></div>");
      });

without it everthing works fine even in firefox and chrome. with working fine i mean the data is being displayed with the disclaimer text.
when i try to use it to replace the disclaimer text it doesn't work in firefox or chrome and for anthor account it doesn't display the data..
Proculopsis

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> - jsFiddle demo</title>
 
  <script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
 
<style type='text/css'>
    .disclaimer { display: none; }
  </style>
 
<script type='text/javascript'>//<![CDATA[
$(function(){
$('#test').click(function() {
    $("a:contains(disclaimer)").replaceWith($(".disclaimer").toggle());
    $(this).attr({disabled: true});
});
});//]]>  

</script>


</head>
<body>
  <div class="disclaimer" style="text-align:right; border:none;"><FONT FACE=Arial SIZE=1 COLOR=000000>Quotes delayed at least 15 minutes. Market data provided by Interactive Data.</FONT></div>

<input id="test" type="button" value="Test" />

<a href="#">disclaimer</a><img src="http://filedb.experts-exchange.com/incoming/2012/03_w12/561331/inv.jpg" />
 
</body>
</html>
SOLUTION
Mrunal

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
eaweb

ASKER
Proculopsis, the table row containing the disclaimer text didn't change.
Please find attached the script i am using. As you will see in the code, the table is being retrieved from another source.
Document2.txt
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
eaweb

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
eaweb

ASKER
it's how i solved it