Jeremy's BlawgSearching for blogs with tag: firefox Sunday, November 23, 2008
November News
Okay I haven't died yet, it's just been pretty boring on the news front for the blog.
Let's see, I've spent the last two weeks practically home alone: two flatmates in the South Island, one in Australia for a week, means one Jeremy at home cooking delicious food for himself, and playing absurd amounts of DotA. Not that either of these things are bad. I brought DotA to work on my iPod in the hope I could attract some interest and get my workmates to play as well.
I had a flatwarming for three of my workmates last night too. They live about 20 minutes up the road from me, so maybe I'll see them on the bus or walking home or something. But it was a pretty cool party, got to hang out with people and socialise and stuff. Woo~. Got caught by the rain as I went home, but luckily the bus was on time and I managed to minimise the wetness.
I've been doing a lot of web development lately. I fixed some spam bot problem with my Shoutbox a few minutes ago, and I thought I'd blog about something that's been infuriating me for the past few weeks.
The majority of the world have this program installed on their machines and actively use this malicious application. I do not know the exact numbers, but whatever the statistics are, it is far too much for people to being using such filth every day.
I am, of course, talking about Internet Explorer.
Who the hell at Microsoft decided to make a substandard browser with so many security flaws and a blatant disregard for web coding standards just to piss developers off? Morons. Absolute bloody morons.
In this site I've been working on (You know the one, Stephen :O), I have this search box that appears onmouseover, and it disappears when you click outside the box, but should remain visible when clicking inside the box. The easiest way to implement this was to cancel the bubbling effect that events have, that is, clicking inside a table will trigger its onclick, its parents onclick and continue up the chain until there are no more onclick handlers.
So, if the table onclick is specified and the event.returnValue parameter is set to false, I can use this value to prevent subsequent calls to the onclick handler. Thus, when it gets to the body onclick, inside the handler, I just return prematurely if event.returnValue is false.
Yup, that's all great. Works wonderfully on Firefox. This behaviour also works on Internet Explorer too...oh, wait. Hold on a second. By specifying that the event's returnValue is now false in Internet Explorer, all onclick handlers no longer work. That means onclicks for anchor tags and submit buttons. What kind of stupid system is that?
I resorted to using the following code:
<script type="text/javascript">
var eventHandled = new Array();
function myFunction(event) {
if (eventHandled[event.type])
return;
eventHandled[event.type] = true;
}
</script>
<body onclick="myFunction(event); eventStates = new Array();">
<table onclick="myFunction(event);">
<tr>
<td>No Click</td>
<td><div onclick="myFunction(event);">Click</div></td>
</tr>
</table>
Clicking on the innermost <div> with "Click" calls myFunction. myFunction sets eventHandled["onclick"] to be true, and prevents bubbling up by halting execution of the onclick in the <table> and <body> tags. Finally at the <body> tag, the states are reset to ensure that the next onclick can be processed. Phew!
Stupid Internet Explorer.
(PS: I should look at getting some syntax highlighting...)
Posted by Jeremy at 9:14pm :: 2 comments :: 
Tags: dota, sidhe, fail, internet explorer, firefox, javascript
C++, achron, admin panel, admissions, alcatraz, alcohol, all blacks, amnesia attack, anniversary, anzac day, apollo justice, armageddon, asian, assault, auditorium, avatar, awkward, bacon, badminton, balloon, bananas, baptism, barbeque, barley water, basic, bbq, beard, beehive, beta, bird, birthday, board games, bored, botanical gardens, braid, breakfast, brownies, bunny, burgerfuel, burma trail, bus strike, cable car, cake, camp, canton, cantonese, cape palliser, car, castle point, cat, central baptist, ceroc, cha, cheese, cheesecake, china, chinatown, chinese new year, chinese tea, chocolate boutique, chocolate frog, chocolate torte, christmas, christmas lights, church, citizenship, clock tower, cluster bombs, codewarrior, cold, compsci230, compsci367, computer, confectionary, conflict, costume, country club, cranium, csc, culture, cute, dinner, diwali, domain name, dota, dragon ball z, driving range, drunk, ds, dumplings, durian, durian tarts, dvd, earthquake, easter, ego, elections, emo, enhance, epic, exams, facebook, fail, faith, feel it, feels like woah, feijoa, feijoa lollies, feijoa vodka, final fantasy, firecracker chicken, firefox, fireworks, flat, flat battery, flickkick, fml, food, food poisoning, fortress, free, fried rice, friendship, frugal, games, gay, ginger fudge, giratina, glasses, goat island, golden gate bridge, google, grades, graduation, graffiti, graffiti wall, grammar, great india, guitar hero, guy fawkes, hacking, hail, halloween, handball, hax, hearts, high ropes, hong kong, hope, hospital, hot chocolate, hot wheels, html tags, hunua, ice blend, ice cream, idol, ignite, inception, indiana jones, integer validation, internet, internet explorer, iphone, iron man, isketch, japanese, japanese buffet, javascript, jazz, json, karaoke, karori baptist, kayaking, kcc, kelburn, keyboard, kirby, kitty, korean, la porchettas, labour weekend, lan, lantern festival, laser strike, lasers, lcd, lemsip, lighthouse, lion king, logic, lord of the rings, luge, luke thompson, mafia, malaysia, mango chicken, mango pudding, mario, mario kart, mario party, marking, maths, matterhorn, mexican, michael jackson, microwave, miles edgeworth, milk tea, mini golf, mission bay, momos, monarch butterfly, monday, monsoon poon, moon cake, mosquitos, mothers day, mousse, movenpick, mt taranaki, mt victoria, mud cake, music, nandos, nap, nasi lemak, nephew, netball, new year, new years, new zealand, newtown fair, noodles, nrl, objection, olympics, one day, opshop, opsm, orewa, oriental bay, orly owl, overtime, oysters, pacman, pancakes, panic, parachute, parade cafe, pasar malam, peking duck, petrol, phoenix wright, physics, piano, pictionary, pike river, pirates, pizza, playstation, poison blob, pokemon, poker, pool, portal, pot luck, power cut, prawn balls, prawns, president, prostitute, protest, psypoke, pub quiz, pudding, puerto rico, puppy, puzzle, python, queens birthday, quiz, rafting, rain, ramen, rave, renkon, resolution, risk, risotto, rock band, rotorua, roundup, ruapehu, rugby, rugby league, rugby league 3, rugby world cup, san francisco, scanf, scones, seafood, seals, shatter, shave for a cure, sheep, shoes, shopping, shout, show and tell, sidhe, sir edmund hillary, skit, slartibartfast, slow motion, snow, snowboard, soap bubble, soccer, soft drinks, sorbet, sour apple rings, sour coke bottles, speed racer, speeding fine, spore, spring, sscanf, stanleys, starcraft, steak, steamboat, storm, strawberry fare, subway, sunburn, super smash bros, swimming, table tennis, te papa, templates, tennis, teppanyaki, teslacoil, test, the dark knight, tiramisu, tofu, tom yum, tongariro, transformers, treasure hunt, trivial pursuit, twister, valentines, villa, vodafone, vortex, waffles, wairarapa, waitangi, walking, warcraft, wat tan hor, website, wedding, wellington, wenderholm, wes carr, whistle, wii, win, wine, winter, yifans, youth band, yum char, zen puzzle garden, zoo, 500
|
:: Google Friend Connect ::
:: Shoutbox ::
:: Graffiti Wall ::
» mucus-free » birthday candles » gaga guwawa? » goodyear » birthday star » Wishmaker » best.name.ever » Benjamin » cawbirdie
:: Archive ::
|