ActiveState Community

just starting with Komodo and Javascript

Posted by JW149 on 2008-12-02 16:23

I wanted to become fluent with Javascript and wanted to use Komodo expecting it to be an END/END IDE. I am having a prblem with getting my script (converted from VBscript) to even compile, but Komodo seems only to want to help AFTER my script compiles
Surely this is not end-to-end
Is there another (yet unseen) option to have Komodo start with writing a script and asisting and debugging as I go. If there are tutorials I should have seen, sorry, where are they?

ericp | Wed, 2008-12-03 10:29

Unfortunately Komodo doesn't support firing up the
JavaScript debugger without any context, and that
context comes from Firefox (since debugging
Komodo would be of interest to maybe about a
dozen people). Here's the process I follow.

First, by editing your scripts in Komodo you get
on-the-fly syntax checking. This won't find all
the problems in a script, of course, but it will
tip you off immediately to any problems in the
syntax.

Now if the script still has errors in it, most
web browsers will quietly fail. I usually prefer
to wrap my scripts like so:

try {
... // full script here
} catch(ex) {
alert("Failed to load script foo.js: " + ex);
}

I assume you're writing cross-browser pages. It's
worth installing the Firefox [Extension Developer's
Extension] (http://ted.mielczarek.org/code/mozilla/extensiondev/)
You can interactively run snippets of JS in various
contexts. There's also a variant for Komodo at
http://community.activestate.com/node/1824, recommended
for building macros of extensions.

Finally once you've gotten that far, you should be able
to debug JS scripts running in Firefox with Komodo.

Hope this helps.

JW149 | Thu, 2008-12-04 14:58

Yes, that helps a lot, thanks
I will try those links