Forum Moderators: open

Message Too Old, No Replies

iCab: Only objects may be called as functions.

         

JAB Creations

5:41 am on Jun 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



iCab is showing me this error... "Only objects may be called as functions" for this script...

XHTML

<a onclick="themesshow();" ...

JavaScript

function themesshow() {change('themes', 'promptshow'); promptshow(); ajaxpage('templates/ajax-prompt-themes.php', 'themesfocus'); document.getElementById('themesfocus').focus();}

The bold text in the JavaScript is what is triggering the console error in iCab. How can I keep iCab smiling?

- John

*Edited for spelling goof, doh!*

[edited by: JAB_Creations at 5:42 am (utc) on June 30, 2007]

penders

7:13 am on Jun 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...and "themesfocus" definitely matches the id of an element elsewhere on the page? Where are you calling themesshow() from? Hhhmmm, but it works in other browsers I guess?

JAB Creations

10:22 am on Jun 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All my code is valid, the id exists without any doubt, and it works in all other browsers. I figure this is either a browser quirk or a really picky JavaScript engine?

- John

Bernard Marx

4:33 pm on Jun 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have no experience of iCab. It does seem odd that this behaviour only occurs in this browser.

Try tried replacing the statement with:

alert(typeof document.getElementById('themesfocus'))

I don't know how reliable the debugger messages are. I'm suspicious that you have a function called promptshow, whilst you are passing the string "promptshow" toa function. You don't happen to have an element with id, "promptshow" somewhere do you? It may cause a gobal namespace conflict.

penders

5:05 pm on Jun 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I figure this is either a browser quirk or a really picky JavaScript engine?

Hhhhmmm, I have no experience of iCab either I'm afraid, but ICab's Wikipedia page does list this as one of its criticisms, "Incompatibility with more intricate JavaScript-powered web sites" (although this is not backed up with any examples).

JAB Creations

10:33 am on Jul 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Bernard is back! :)

"iCab JavaScript Alert"
"! Object"
(Dialog was opened by "((my local IP here))"

What this script does is open a layer dead center of the page...the AJAX loads a template page (content not included reduces overall page load, template page is cached, genius really). The last part that iCab isn't able to swallow is for accessibilities. It gives focus to the targeted id so (right now only Gecko browsers (for the most part) correctly handle tabbed navigation) users can use the keyboard to navigate the page (without any need for a mouse).

- John

JAB Creations

3:35 pm on Jul 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Forgot to answer a question of yours, no there is are no ids with the same name as any of my JavaScript functions.

- John

Bernard Marx

5:46 pm on Jul 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm lost. I didn't know that DIVs have a focus method.

(Doesn't give an error. It just doesn't do anything)

JAB Creations

6:30 pm on Jul 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Overflow divisible elements do, in Gecko that is. It's a shortcoming of the W3C and it's contributors to have given keyboard script support (onkey-x-y-z) but no keyboard access (tabindex). Gecko (1.8+ I recall reading though could be wrong) supports tabindex on all elements.

Anyway if I don't give the overflow element focus it messes up the second tabbing sequence (when the user has exhausted all possible tabable elements and it recycles) in Gecko. So it's part of what I have to do to allow folks using Gecko to have full keyboard accessibility.

So that's not an error message? Yes, it does not do anything in iCab.

- John

Bernard Marx

4:56 am on Jul 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So that's not an error message?

Sorry - I was testng in Firefox.