Question

Whilst trying to open a Foundation 5 (5.2.1) reveal via javascript ($('#reveal-id').foundation('reveal', 'open')) I've been getting these annoying errors:

this.dispatchevent is not a function

Depending on what I changed, sometimes it became:

settings is undefined

After a lot of cursing and ripping everything out (leaving me with this jsFiddle) I've found the problem and wanted to share the solution with you.

Was it helpful?

Solution

Short answer

If you have the FireQuery extension (1.4.1) for Firebug installed, that might be the culprit.

Long answer

While using that jsFiddle it turned out to be working in both Chrome and FF. After copying the code and using it as plain HTML, it still worked in Chrome but failed in FF. But it was exactly the same code! At that point I started disabling FF add-ons. The journey ended when I arrived at FireQuery. Hopefully I can save some of you from a very frustrating day with this. Why it's actually still working in jsFiddle with the add-on enabled eludes me at this point. I also don't know if it is limited to OSX only, could be on Windows as well.

OTHER TIPS

Note that the functionality of including an external script is already implemented in Firebug via the include() command. jQuery is already available as alias by default, so just call

include("jquery")

and you're good to go.

For the part of inspecting jQuery data attached to the HTML elements you can use the (commercial) Illuminations for Developers. Though it doesn't display the data inline inside the HTML panel, which makes it hard to use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top