[RESOLVED] JavaScript: Remove <table>blah</table> - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: [RESOLVED] JavaScript: Remove <table>blah</table> (/showthread.php?tid=93701) [RESOLVED] JavaScript: Remove <table>blah</table> by macgyver08 on 01-29-2010 at 09:32 PM
I've tried... code:...but it doesn't seem to be working. RE: JavaScript: Remove <table>blah</table> by matty on 01-29-2010 at 09:37 PM Are you trying to replace everything including the <table></table>? RE: RE: JavaScript: Remove <table>blah</table> by macgyver08 on 01-29-2010 at 09:39 PM
quote: Yes, the table tags, and everything they contain. RE: JavaScript: Remove <table>blah</table> by Spunky on 01-29-2010 at 09:45 PM
js code: Should do it. EDIT: Changed it to allow for attributes in the table tag such as styles, class, id etc. RE: RE: JavaScript: Remove <table>blah</table> by macgyver08 on 01-29-2010 at 09:59 PM
quote:Doesn't appear to be working EDIT: I didn't see your edit before i said it didn't work. Let me try your new one. RE: JavaScript: Remove <table>blah</table> by macgyver08 on 01-29-2010 at 10:03 PM
New one isn't working either. I don't know if it's your code,or my code that I've pasted it to though. RE: JavaScript: Remove <table>blah</table> by Spunky on 01-29-2010 at 10:13 PM
Yes, it does work. Maybe there is some strange character in the html? RE: JavaScript: Remove <table>blah</table> by macgyver08 on 01-29-2010 at 10:18 PM
Well...it's not working with my code for some reason. I don't know why. What strange character in the HTML could stop it from working? RE: JavaScript: Remove <table>blah</table> by Spunky on 01-29-2010 at 10:29 PM
quote: I dunno, experiencing a problem with it too now with a more complicated table RE: JavaScript: Remove <table>blah</table> by Spunky on 01-29-2010 at 10:40 PM
Line breaks are casuing it to break and I can't get the m modifier to work so we can add an extra replace. js code: If you wanted to, you could replace the \n with a unique string so it can be put back together again... js code: RE: JavaScript: Remove <table>blah</table> by macgyver08 on 01-29-2010 at 11:12 PM
Hey, I found the problem. It was that what I was testing it on was on multiple lines, so I had to use the metacharacters \r and \n. code: Thanks for your help though! I really appreciate it RE: JavaScript: Remove <table>blah</table> by Spunky on 01-29-2010 at 11:48 PM Well done, it's a lot more elegant than my solution, but couldn't remember the right syntax for it at the time |