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
eawebAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

eawebAuthor Commented:
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..
0
ProculopsisCommented:
<!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>
0
MrunalCommented:
Check that if the object you are accessing by:
$(":contains('disclaimer'):last", "table").parents("td:first")
is getting properly.
Something you are getting undefined in this selector.

Can you share your html also so that we can give you exact solution?

If you are getting that object correctly, then instead of directly assigning its html value, first clear its contents then assign html to it.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

eawebAuthor Commented:
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
0
eawebAuthor Commented:
Hi, i found the error. The ajax code was misplaced. It needed to be placed just under the retrieved table containing the disclaimer text. here the solution:

***********************************
<script language="JavaScript" type="text/javascript" src="includes/js/jquery-1.7.1.min.js"></script>

<script language='JavaScript' >
document.write('<table  cellpadding="0" cellspacing="0" align="center" style="border-width: 1px;  border-style: solid; border-color: #CCCCCC;">');
document.write('<tr><td>');
document.write('<table border="0" align="center" >');
document.write('<!-- MarketWatch market summary -->');
document.write('<tr><td>');
document.write('<link rel="stylesheet" href="https://custom.gtm.idmanagedsolutions.com/custom/alliance/ii/alliancestyle.asp?siteid=D33E5570-0390-4BA1-ADE2-0DFC506881F0" type="text/css" media="all"><form method="GET">');
</script>

<script language='JavaScript' > 
function getMWArgs(){

        var args = new Object();                //object for storing param=value pairs
        var query = location.search.substring(1); //grab the text after the '?'
        var pairs = query.split("&");           //create an array of param=value pairs
      var newstring = "";

         for(var i = 0; i < pairs.length; i++){ //loop through the array
                var pos = pairs[x].indexOf('='); //check for an '='
                if (pos == -1) continue; //no '=', skip this array dimention
                var argname = pairs[x].substring(0,pos); //extract parameter name
                //skip parameters that are hard coded in the calling script block
if(argname.toLowerCase() != "siteid" && argname.toLowerCase() != "urlpull" && argname.toLowerCase() != "exstyle"){
                        newstring += pairs[x] + "&"  //concatenate the new string
                }
        }


        return newstring;
}


document.write ('<' + "script language=\"JavaScript\" type=\"text/javascript\" src=\"https://custom.gtm.idmanagedsolutions.com/custom/alliance/ii/dquote.asp?siteid=5F70B991-2B67-4808-940C-8BB73A9D4B54&urlpull=<#itm_text name="INV_URLPULL_ITMVI_BALINQRECEIPT95">&exstyle=t");

if (location.search.toString().indexOf("symb") != -1) {
      if (location.search.toString().indexOf("osymb") == -1) {
      //hit
            //alert("symb but no osymb");      
      } else {
            document.write('&symb=djia&"');
      }
} else {
      document.write('&symb=djia&"');
}

document.write(getMWArgs());
document.write("\">" );

document.write("</");
document.writeln("script>");

$(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>");
      });

</script>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eawebAuthor Commented:
it's how i solved it
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.