Compatibility problem with Safari

Posted by Chris Bailey-2 on
URL: https://discuss.orbeon.com/Compatibility-problem-with-Safari-tp33596.html

Hi Team,

I recently tried to view my xforms app in Safari (1.3.2) and was surprised
to find that every xform interaction produces the following error message:

Error while processing response: Value undefined (result of expression
this._http_header.hasOwnProperty) is not object.

This error also occurred when I viewed the www.orbeon.com demo pages as
well.

A bit of Google searching found this page:
<http://phrogz.net/JS/hasOwnProperty.html> which indicates that "Safari (up
to and including version 2.0) does not support this method."


I found this workaround on a blog
<http://erik.eae.net/archives/2005/06/06/22.13.54>:
if( !Object.prototype.hasOwnProperty )
{
        Object.prototype.hasOwnProperty = function( property )
        {
                try
                {
                        var prototype = this.constructor.prototype;
                        while( prototype )
                        {
                                if( prototype[ property ] == this[ property ] )
                                {
                                        return false;
                                }
                                prototype = prototype.prototype;
                        }
                } catch( e ) {}
                        return true;
                }
}

I also notice YAHOO.lang provides a hasOwnProperty function. Maybe you can
switch over to using this (or modify your supported browser statement).

Chris.
--
----------------------
Chris Bailey
[hidden email]



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws