Boylett Posted June 18, 2009 Share Posted June 18, 2009 Hi I have some JS which works in Opera, but doesn't work in FireFox function AddBBCode(object,start,end) { if(object.selectionStart != null) { object.value = object.value.substr(0,object.selectionStart)+ start+ object.value.substr(object.selectionStart,object.selectionEnd - object.selectionStart)+ end+ object.value.substr(object.selectionEnd); } else alert( "Your browser doesn't support JavaScript Range, so can't use these buttons correctly. Please upgrade to FireFox or Opera\r\n\r\n"+ "The BBCode you selected was: "+start+end ); } The code would get called from a button, i.e.: onclick="javascript:AddBBCode(textarea,'[b]','[/b]');" On IE it throws up the alert, but I'm not bother about that. Please tell me how to get FireFox to work with it aswell Cheers, Link to comment https://forums.phpfreaks.com/topic/162816-some-javascript-which-works-in-opera-9-and-not-firefox-3/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.