News:

Join the Facebook Fan Page.

Main Menu

Cross-Browser

Started by TheGamer, July 25, 2005, 04:13:18 PM

Previous topic - Next topic

TheGamer

Can someone help me turn this script into a cross-browser script (FF, Opera). For some reason, it currently only works with Internet Explorer. Please help me. Trekkie101 and I created this today. After many attemps at programming it correctly, finally, I came up with this, which seems to be the best so far, except it only works in IE. Most of my forum's members are using Firefox. One person (to my knowledge) is using Opera, and that is good ol' DantheMan. Yes, I'm using a YaBB board.

<script language="javascript">
//Text Replacement
var range = document.body.createTextRange();
range.collapse(true);

while (range.findText("0 messages")){
range.pasteHTML('No messages');
range.collapse(false);
}
</script>

kegobeer

document.body.createTextRange() is IE specific and doesn't work in other browsers.  Perhaps this link will be of assistance.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

TheGamer

Thanks. Sorry to be the party pooper, but that page just looks like a little bit of nothing to me. You wouldn't mind just doing what needs to be done to the code to make it cross browser, would you?  :-\ sorry.

kegobeer

I'm no expert in Javascript, that's why I posted a link I think is relevant.  Hopefully someone else with more Javascript knowledge can help you.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

TheGamer

Alright, thank you anyway... Anyone else?

Advertisement: