From: Andrew Poulos on
If I have this

function fun() {
// evaluate something
return something;
}

try {
var foo = fun();
} catch (err) {
alert("fun error");
}

and there's an error in the function 'fun' does the try/catch catch it?

Andrew Poulos

From: Stevo on
Andrew Poulos wrote:
> If I have this
>
> function fun() {
> // evaluate something
> return something;
> }
>
> try {
> var foo = fun();
> } catch (err) {
> alert("fun error");
> }
>
> and there's an error in the function 'fun' does the try/catch catch it?
>
> Andrew Poulos

Yes.

btw, it's probably quicker to try it than ask the question ;-)
From: Thomas 'PointedEars' Lahn on
Andrew Poulos wrote:

> If I have this
>
> function fun() {
> // evaluate something
> return something;
> }
>
> try {
> var foo = fun();
> } catch (err) {
> alert("fun error");
> }
>
> and there's an error in the function 'fun' does the try/catch catch it?

Depends on the implementation and the error.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)