Hi,
I don't know if anyone is going to be able to help here or not... Sorry if there's not enough information.
I'm trying to put a spoiler tag into a .js file so it will display in a forum live preview, but it won't work and FireFox and IE just say there is a syntax error...
Anyway, here is the code:
Any help would be appreciated,Code:ubbcstr=ubbcstr.replace(/\[spoiler\](.*?)\[\/spoiler\]/ig, "<div class='message'><div style='padding-bottom: 1px;'><b>Spoiler:</b> <input type='button' value='Show' onClick='if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }'></div><div class='spoiler'><div style='display: none;'>$1</div></div></div>");
Thanks.



Reply With Quote




Bookmarks