Hm, I've had this happen on IE, but never on Safari. In any event, see
if this works:

if (typeof functionName !== "undefined") { functionName(params); }

If that fails, test on else:

if (typeof functionName !== "undefined") {
    functionName(params);
} else {
    alert (functionName);
}

On Sep 14, 9:30 pm, Matt Patenaude <[EMAIL PROTECTED]> wrote:
> OK, so, I've got a weird iPhone problem. One of the web applications
> I'm working on has to test for the existence of a function, and if it
> exists, execute it.
>
> On a normal browser, I'd do something like this:
>
> if (functionName) functionName(params);
>
> And it works perfectly on every browser I've tried, including Safari 3
> Beta. However, it not only fails on the iPhone, but appears to trigger
> some sort of error. I say this, because the following:
>
> alert('test one');
> if (functionName) functionName(params);
> alert('test two');
>
> ... only shows 'test one'. Since execution stops, that leads me to
> believe something goes pretty foul somewhere. I've also tried
> window.functionName, assigning it to the containing object (then using
> "this.functionName"), and a few things with the "typeof" operator, to
> no success.
>
> Anyone know why this fails, or more importantly, how I might
> circumvent it on the iPhone beyond hard-coding my function names?
>
> Thanks!
>
> -Matt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to