How to replace a block of HTML with another block of HTML using jQuery -
would appreciate based on condition, replace following html block:
<table class="t12pagebody" cellpadding="0" cellspacing="0" width="100%" summary=""> <tr><td colspan="2">#region_position_01#</td></tr> </table> <table width="100%" summary=""> <tr> <td class="t12contentbody" valign="top"> #success_message# #notification_message# #box_body# #region_position_04##region_position_05##region_position_06##region_position_07##region_position_08#</td> <td align="right" valign="top" class="t12contentbody">#region_position_03#<br /></td> </tr> </table>
with block:
<div id = "banner"> <div class="logo"></div> <img src="http://www.abc.com/home/images/spacer.gif" height="35" width="180" border="0" alt=""> <font class="bannertext">&appname.</font> <div class="bannertext"> <div class="hmenu"><ul>&application_links.</ul></div> </div>
i looked @ replace function in jquery unsure how apply.
thanks.
var newhtml = '<div id = "banner"><div class="logo"></div>' + '<img src="http://www.abc.com/home/images/spacer.gif" ' + 'height="35" width="180" border="0" alt=""> <font ' + 'class="bannertext">&appname.</font><div class="bannertext">' + '<div class="hmenu"><ul>&application_links.</ul>' + '</div></div>'; $('table.t12pagebody').replacewith(newhtml);
Comments
Post a Comment