Hi, this blog is no longer maintained, my new blog is here

Ruby On Rails and a Conning Israeli entrepreneur

Showing posts with label ie. Show all posts
Showing posts with label ie. Show all posts

Debugging Javascript in Web Applications: Major browser roundup

Most web applications that i know, are based on interpreted script languages (PHP, Ruby, Python) and some are compiled (.Net, Java). The complied languages often (if not always) come with a full environment, IDE and a debugger for the server side code, the interpreted languages aren't and the developer is more than ofter required to load the application and page in order to check for syntax error and use debug prints as the most basic tool of debugging.
Javascript is an exception, it's a de-facto web development script language, but it's rendering engine and debugging options vary from browser to browser.
I gathered up a list of common web debugging tools for Javascript. i will be happy to get some more ideas from everyone.
here we go:

The ultimate solution - Firebug addon
ok, i know what you might say: "it's a FIREFOX addon!, how can it be THE ultimate solution?".
Well, good news.
Along side the plain firefox addon, there's also a lite version that runs as a seperate javascript on Safari, Opera and yes, IE.
The Lite version is not as comprehensive as the addon, but it's more than a blessing when dealing with IE javascript bugs ("line:33, char:33 crap").

General

JSLINT.COM - Javascript verifier
Just paste your JS code and let this cute little tool and watch the Javascript errors flow back at you. important to add that it does not recognize frameworks conventions (the jQuery $ selector is considered as a Global definition, use JQuery instead) and will not identify browser specific issues, it's marely a javascript syntax checker.

BlackBird.js - Cross browser javascript logger
Blackbird offers a dead-simple way to log messages in JavaScript and an attractive console to view and filter them.

Internet Explorer - Evil, annoying, can't we just drop it?

DebugBar - Firebug's little brother
debugbar is a nice Firebug mockup for IE, simple but not as strong as Firebug. problems are that it's not free, and you'll have to install a whole lot of crap on your computer. too bad.
you can also checkout the Compainion.js free version of a javascript console for IE.

IE Developer Toolbar - HTML, CSS, no Javascript
Let's face it, the IE's so-called javascript engine just sucks, any attempt they'll do to fix it must start by simply re-fuckin-write it.
The IE Developer Toolbar is a poor attempt to find a solution for some of the problems facing a web developer when dealing with IE, but at least it's something.

Safari - When i am not working, that's the one.
*by saying Safari, i mean the MacOS one, not that fucked up Windows version, yak.

Safari came from Apple, so it's probably padded with thought, intention and considiration to any kind of end-user, as well as a developer.
The Safari developer tools are nice, from a very descriptive, good looking Console and Network stats, to a rendering engine that can mimic other browsers (although i am not sure how good it is.).
This "How to Debug Javascript in Safari" article contains all you'll need to know.

FireFox - by the developers, for the developers

I have to say it, but if you made it this far and you still havn't figured out how to debug Javascript in Firefox, you have a problem.
Debugging Javascript is all about the Addons engine. This huge gallery contains a lot of web development related addons and tools, just go there and pick what you want.
Two addons you'll have to pay attention to are the Web Developer toolbar addon, and Firebug we've mentioned before.


IE8 RC1: IE6 again?

IE6 was, and still is the worst nightmare for web developers (client side mostly).
This browser/disease who surfaced the Web years ago, still acts as a major market share holder (about 67% these days) and hurts users, developers and basically everyone who comes across it's path.
I am a web developer and there are many in my profession who can really understand this evil browser, much more than the common user who think the "internet is the blue icon...no?", we're still dealing with CSS Hacks, HTML and JavaScript that IE6 forced us to write, PNG manipulation (what did we ask for?! transparency?) and much more.
So the nearing release of IE8 should be good news, right? Everybody moves up a notch, even the poor people who have to use IE6 in the working place (yeah, there are more than a couple of these companies in Israel).

Not so fast. What made IE6 so bad is that it's bugs became standards. That people accepted it's negligence as a permanent status and began to work around it's bugs around the clock, forcing themselves and other to years of web-desperation.
On the other hand, these people web sites usually were their paychecks, so they really didn't have too much time to wait for dear old Microsoft to release a patch/fix/update that will fix their specific bug (and probably bringing 300 other bugs), so they hack CSS, HTML, JavaScript and Images in order to make it work. Before they knew it, the bugs and other demented issues from the IE standard demonic bugs, have become the standard.

After trying out IE8 RC1, i can say that i am worried, Tables that don't render correctly, JavaScript calls that crash the browser into oblivion and meta tags that order the browser to render the page as IE7, get real.
It's not just the bugs, it's the fact that the IE8 development seems to be giving these bugs the backend, it's been there, and have been reported already in Beta (i know i did).
If IE8 makes it out with this huge list of basic usage bugs, we are going on round 2 with IE6, And all of us web developers and designers will travel back in time to 2002.

IE6 for my opinion was the reason that almost nothing moved around web development and web applications between 2002/3 up until FireFox came along, when there was no competition, IE rules with it's bugs without nothing to worry about and with nobody has the ability to point out the exact things he wish to have in a browser, so Microsoft did nothing until FireFox became strong enough to threat the king.
Although that i would be happy to extinguisher the very existence of the IE family, i will be very happy to see a normal, advanced browser coming from Microsoft.

So, if you want to make sure that IE8 isn't a new IE6 in a new outfit, get yourself a copy of IE8 and start shooting some feedback at Microsoft. Also, vote up those bugs that really need fixing. Even if you don't use IE in your day-to-day work, if you develop web software, this is a matter of raising the bar, before they make a new one, very very low one.

Get Internet Explorer 8 and get to work.

Firefox vs. Explorer: the power of free will

please can i have firefox?
During the past 2 days, I've been struggling with someone on one of the web development forums i am participating in. Swords were drown when someone else asked 'why should someone choose not to use IE?'.

First i have to clear the background. In Israel, like every other place in the world, IE still rules. The problem in Israel is that there is not enough exposure for other browsers, and even to other OS besides windows. People are not familiar with Ubuntu (almost) at all, and the Macs are pretty expensive in Israel, relatively a lot more than it is elsewhere.
This causes some serious problems in the Israeli online experience, government and other public service provider websites can not be viewed in other browsers except IE, and the web developer community is in a consistant battle to explain to some low-level yet common development firms, why you should implement web standards and support other browsers.
Courses and training programs are more than often don't approach standards and semantic HTML issues, but there are numerous which hold ActiveX in their syllabuses

Back to business, that guy explained that
"People who don't use IE are a minority and if they choose to handicap themselves, it's not my or the government responsibility to enable the support for other browsers".
What can you say about that?

Putting a side everything i have against Microsoft as a corporation, i think that IE is the handicaped browser, not Firefox/Opera/every other browser.
Handicap is not a plugin and extenstion enabled browser, it's the browser that can't support 40% of the W3C Standard for example.
You can find too many hits on why you should dump IE(#2, #3 so on..) and i don't think it's the Firefox hype talking, it's simply the people who had enough with their browser doing stuff he shouldn't do, and not what they want or asked it to do.

BTW, i ended that discussion with that guy... you can't argue with someone that can't understand the meaning of the things you say, just like one of the other forum users said: "Arguing the benefits of Firefox over IE with an iE user is like arguing the advantages of a flashlight with a caveman carrying a torch."

Not tested in IE initiative: a new savethedevelopers.com

savethedevelopers.com used to be a great script that pops up when the client's browser was IE6, warning him about the mischief ways of that browser and urging the user to either update to IE7 or go the happy road on Firefox.
Than, something weird happend.
The website stopped working and now redirects to Microsoft's IE download page... yak.

The "not tested in IE initiative" tries to re-incarnate that thought. So if you are unsure that your website will be displayed correctly on IE6, use one of these icons link to the project's home page.


IE Testing: Internet Explorer cannot open the Internet site. Operation aborted.


haaah... the joy of working with IE never ceases to amaze me. I was trying to test one of my pages on IE7 when this ruthless message arrived uninvited, needless to say that the immediate action that IE preforms is to redirect you to a 404 default page, discarding from you the option of viewing some Javascript errors and basically take care of the problem.

The Issue:
Internet Explorer 6 and 7 are getting really upset when you don't give them the chance to render the entire HTML, and preform a DOM related actions (appending/removing child elements for an instance).
This is mostly a response to a >script< tag containing a DOM changing javascript.

Solution:
If you are using JQuery like i am, use the document.ready function around your inline


The Web Ask eizesus.com

Subscribe

    follow me on Twitter

    Twiters Around

    About Me

    My photo
    I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.

    Labels