Event.observe IE9 - magento

While using Magento 1.9 (I think that's not very important) I've got following errors in IE9:
SCRIPT438: Object doesn't support property or method 'observe'
validation.js, line 98 character 35
This exception points to an Event.observe call, and there are more exceptions like that.
The prototype version is 1.7.0 and it's loading as first script (by the script src) in header element. All the errors occurs in scripts which should be loaded/initialized after the prototype.js.
I'm debugging it for a few hours without results. The problem does not occur in other browsers.
Do you know how to fix that?

Try upgrading to the latest version of Prototype, and see if that solves the issue. There was a lot of work done in IE compatibility during 1.7.3.

Related

require-less throwing lessc error in firefox

So I'm working with RequireJS and BackboneJS. I can get everything to work fine in Chrome but when I load up in Firefox I'm getting that lessc is not defined. Obviously pulling out the less files will prevent the error from occurring. Does anyone have any ideas why require is unable to load lessc in firefox but its doing fine in chrome?
Screenshot:
http://screencast.com/t/WenocFdCA0V
Video w/ lessc not being defined in Chrome but not Firefox
http://screencast.com/t/ac96qZrpQb3R
Let me know what other info may be useful.
Thanks in advance!
Seth
less.js is broken, because it uses loadStyles before it defines it, and Firefox stopped hoisting functions according to the spec. There are probably more such mistakes, but this is the first one that is triggered during execution. Please note that the minified version is not affected because of the minification rewriting the code.
less-require is similarly broken, as it contains less.js and therefore contains the same bug.
You might want to replace lessc.js in require-less with the 1.5 beta or master version of less.js to work around this, or wait for upstream to officially release it and require-less to pick it up.
However, it appears that lessc.js is a modified version, so it isn't likely as easy as replacing the file. You would need to merge the changes back.
It might be easier just to move the affected latedefs around until it runs correctly instead of upgrading to a later less.js version.

IE 8 specific issue with angularjs directives

This is a boiled-down repro of a problem I'm having in a much larger app. I can't seem to find a solution for it. If you run this in IE8, the ui-popup directive doesn't work, and the script debugger console has the error message "TypeError: Object doesn't support this property or methodundefined".
I tried to strip away as many directives, controllers, and as much code as possible.
jsFiddle Link
If you downgrade angularjs to 1.0.3 it works in ie8.
Edit
Angular 1.0.5 also works.

Add-on support after update

In a previous project I wrote a Firefox extensions - nothing too complex - that used xmpp4moz, an add-on for Firefox that integrates the xmpp/Jabber protocol. At that time Firefox 3.6 most the most recent one and everything worked quite well. Now with Firefox 5 xmpp4moz does produces errors, starting with
Error: Component.classes['#something/something/...'] is undefined
and naturally resulting in further 'undefined' errors. In some sense this is ok, since xmpp4moz is officially not available for Firefox 5. And given that the last update was in 2009 I don't really expect a updated version. Currently I see the following two options:
Looking for alternatives/workarounds/...; so far I haven't found anything. Any ideas?
Trying to update/modify xmpp4moz myself to make it running in Firefox 5
The thing is that at the moment I cannot really assess the required efforts.
Summing up, I'm stuck :)
The sameplace download at http://www.sameplace.cc/ appears to include a slightly newer version of xmpp4moz (I didn't really check whether install.rdf is the only difference from the source code repository however). Still, it is only compatible with Firefox 3.6. From the look of it, there are no big issues, main problem is that the XPCOM components aren't being registered. See https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0 for information on the relevant changes, usually updating the components and chrome.manifest is easy.

flXHR - getting started (a simple question)

I am trying to use the flXHR javascript library for making cross-domain calls.
I got stuck at the begining.
As they say in the docs, I copied the /deploy directory's content to a /scripts directory.
All the dependencies are supposed to be included in the flXHR download.
This is my html, which returns several errors:
the errors:
y.base_path is undefined
y.checkplayer is undefined
y.ua is undefined
E.attachEvent is not a function
thanks
flXHR is tested and works (AFAIK) on all major browsers' latest released versions. I don't revalidate the test-suite every single new release of any browser, but I do so from time to time.
With respect to the "base_path is undefined" error... the problem is not with flXHR (or CheckPlayer), but with how Firebug traps for JS errors.
I have a try/catch block around access of that variable, and if it's not present, then I take an alternate action. From a normal JS perspective, this is not a JS error, because the try/catch block catches it and deals with it. But Firebug still registers it as an error. This error is erroneous, and as far as I know is not going to affect any behavior in the rest of your code.
Again, to my knowledge, flXHR is currently working in all browsers. If you have issues, please visit the flXHR forum on http://flXHR.flensed.com.
I noticed the "y.base_path is undefined" error sometimes, but only when Firebug is open. Try closing firebug (or use a different browser) and see what happens.

Firefox Gecko SDK : NPP_GetValue not getting called

I have tried out the NPRuntime sample provided with the Gecko SDK 1.9.1 with the help of this link.
It works perfectly fine with Firefox 3.6.
Following the above steps I created a new scripting plugin (npmyplugin.dll). I am currently placing npmyplugin.dll in a folder other than Firefox/plugins. I am registering the associated mime-type and plugin path in the registry. The plugin gets loaded properly. But now the browser is not calling NPP_GetValue.
I was suspecting that it must be because I am placing the plugin in a directory other than Firefox/plugins. Hence I did the same with npruntime.dll (the sample which comes with Gecko sdk). Suprisingly npruntime.dll scripting was working. Please guide me whether I missing anything important while creating the new plugin.
NPP_GetValue doesn't get called to get the NPObject until the first time you access it with javascript in many cases. When you do a getElementById, it will make the call.
Likely other calls to GetValue are being made, but you aren't seeing them because you aren't handling them. However, that's still not guaranteed.
Sorry for replying so late. I somehow solved the problem. I was embedding the plugin using tag
then i wrote a small javascript code
var MyWorkingPlugin = document.getElementById('MyPlugin');
It seems that after executing the above javascript NPP_GetValue was called. Currently I have no convincing reason why it happened but it worked and I am happy for the moment. If anyone can explain the above behaviour please let us know.

Resources