eaweb
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
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
<!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)" ).replaceW ith($(".di sclaimer") .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><im g src="http://filedb.experts-exchange.com/incoming/2012/03_w12/561331/inv.jpg" />
</body>
</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'>//<
$(function(){
$('#test').click(function(
$("a:contains(disclaimer)"
$(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><im
</body>
</html>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it's how i solved it
ASKER
using (jquery-1.7.1.min.js)
$(document).ready(function
$(":contains('disclaimer')
});
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..