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, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.