Internet Explorer

I just wrote a JavaScript function which worked perfectly first time! I was more than a little chuffed until I tried it out in Internet Explorer in which it did nothing. The reason being that, in IE, there is no simple way to find the start and end points of a selected piece of text within a textarea. You can find out where they are in terms of pixels (because that’s really useful) but not in terms of numbers of letters.

Here’s a useful piece of code that should be put on ALL websites to improve the quality of the internet as a whole:

<!--[if IE]>
	<style>body,html{height:100%;}</style><div style="font-size:64px;color:white;background-color:red;width:100%;height:100%;text-align:center">Get a better browser! This one sucks! Seriously.</div>
<![endif]-->

Just stick that just after your body tag and leave the IE users to fend for themselves.

Sorry, I had a good weekend ahead of me and then spent it in bed, ill. Now it’s Monday and I’m back at work and pissed off. So fuck IE. Fuck Microsoft. And fuck you, too. Yeah, you heard me. *waves middle fingers around*

P.S. Here’s the function that I was working on:

function gobold(field){
	var target = document.getElementById(field)
	
	var x = target.selectionStart;
	var y = target.selectionEnd;
	var a = target.value.substr(0,x);
	var b = target.value.substring(x,y);
	var c = target.value.substring(y);
	
	target.value = a + '<b>' + b + '</b>' + c;
}

That’ll wrap some bold tags around the selected text in a textarea “field”.

Advertisements

About Mr Chimp

I make music, draw pictures, browse the internet, programme, and make sweet, sweet cups of tea until the early hours.
This entry was posted in Uncategorized and tagged , , , , , , . Bookmark the permalink.

5 Responses to Internet Explorer

  1. Dan says:

    ha, I take it your not so keen to get stuck in to the WOC IE6 fixes then? :P

  2. Mr Chimp says:

    Go stick your head in a pig.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s