I got Safari 1.3 working with the UpdatePanel. It appears there is an error in the production version ofMicrosoftAjax.js. If you include the debug version (MicrosoftAjax.debug.js) manualy, the UpdatePanel works with Safari 1.3. You must modify the Script Manager as follows:
<asp:ScriptManager ID="ScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Name="MicrosoftAjax.js" Path="~/js/MicrosoftAjax.debug.js" /> </Scripts> </asp:ScriptManager>
Copy theMicrosoftAjax.debug.js into your site structure. The above sample uses ~/js/
The next step I started to modify the source code. I found the follwinginformation and included it into my code:
httpRequest = new XMLHttpRequest();httpRequest.overrideMimeType('text/xml');
Earlier version of Mozilla had problems withSys.UI.DomElement.getLocation. The original code caused Mozilla 1.2 and Netscape 7.x trouble. Microsoft documents this functionhere. The description there is not very clear. So I did some tests:
Gets the absolute position of an element relative to the upper-left corner of the browser window.
Is incorrect, but
x = The number of pixels between the element and the left edge of the parent frame.
is the way that the Internet Explorer part of the javascript works. As a result I replaced more than 200 lines of code with this:
Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { /// <param name="element" domElement="true"></param> /// <returns type="Sys.UI.Point"></returns> var e = Function._validateParams(arguments,[{name:"element",domElement:true}]); if(e) throw e;while(element.nodeType === 3)element = element.parentNode;if(element.nodeType === 9)return new Sys.UI.Point(0,0);return new Sys.UI.Point(getNodeLeft(element), getNodeTop(element)); function getNodeLeft(node) { var x = 0; if(node.x) return node.x; while(node) { x += node.offsetLeft; node = node.offsetParent; } return x; } function getNodeTop(node) { var y = 0; if(node.y) return node.y; while(node) { y += node.offsetTop; node = node.offsetParent; } return y; }}
In therory the UpdatePanel shoud work with the following browsers:
Internet Explorer 5.5 and upCorrection to the above:
Opera 8.0 does not support the setRequestHeader function. Therefore it cannot be used for AJAX.net doing POSTs. In this case the UpdatePanel requires at leastOpera 8.5. The timer-script has some problems with 8.5. To be on the save side, use Opera 9.x.
K.
I have identified the Safari 1.3.2 problem: The Safari Javascript Parser has a bug. Thethrowrequires to have asemicolonat the and of the statement.
Example:
default:throw Error.format(Sys.Res.formatInvalidString)}
must be replaced with:
default:throw Error.format(Sys.Res.formatInvalidString);}
Even these statements:
Sys.UI.VisibilityMode=function(){throw Error.notImplemented()};
Should be replaced with
Sys.UI.VisibilityMode=function(){throw Error.notImplemented();};
In addition I found some corruption in the MicrosofAjax.js file. I will have a fixed production version (MicrosoftAjax.KBFix) shortly.
K.
Does anyone know where I can download the Safari 1.3.2 compatible MicrosoftAjax.js file?
I′m really interested in this as well. Any news? kurtBrunner?
a3r0s0l,
Any luck finding the file? Please let me know if you ever find it, and vice versa.
I am sorry: The above link can be easily missed. The fix can be downloaded here:
http://www2.hawaii.edu/~brunner/KBFixAjax.zip
The Test site is here:
http://laelabs.hawaii.edu/ajax/
Please provide feedback. Good luck!
Kurt
Hi Kurt,
I implemented KbFixAjax but I am getting the following error:
Parser Error Message:
System.Web.UI.ScriptReferenceCollection must have items of type 'System.Web.UI.ScriptReference'. 'ScriptReference' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.
Thank you,
Richard
No comments:
Post a Comment