Safari: 'attachEvent' is not a valid argument

Last post 10-03-2006 1:11 PM by mikebridge. 0 replies.

Sort Posts:

  • Safari: 'attachEvent' is not a valid argument

    10-03-2006, 1:11 PM
    • Member
      118 point Member
    • mikebridge
    • Member since 10-03-2006, 1:02 PM
    • Edmonton, Canada
    • Posts 33

    Hi-

    I think the compatibility layer would normally add the attachEvent method somehow, but I'm having a problem on Safari 2.0.4 with executing an Atlas function from javascript.  The error I'm getting is this:

    'attachEvent' is not a valid argument. It should be one of
    onMethodComplete,onMethodTimeout,onMethodError,onMethodAborted,userContext,timeoutInterval,priority,useGetMethod

    Here's the code I'm using.  Clicking on the link gives the contents of the text box to the web service "Echo", which just echoes it back. The result is put in an alert() box.  This works fine in FireFox and IE6.  My Microsoft.Web.Atlas DLL says 2.0.50727.60725.

    Thanks,

     -Mike
     

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AtlasTest.aspx.cs" Inherits="BridgeCanada.Temp.Safari.AtlasTest" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Safari Test</title>
        <atlas:ScriptManager runat="server" ID="scriptManager1">
            <services>
                <atlas:ServiceReference Path="HelloWorld.asmx" />
            </services>
        </atlas:ScriptManager>    
        <script language="javascript" type="text/javascript">
        function SafariDemo(testtext) {
            this.testtext=testtext;
        }
        
        // WEBSERVICE CALLBACK IF THE SERVICE IS UNAVAILABLE
        SafariDemo.prototype.OnWebServiceTimeOut = function() {
                alert("Timed Out");
        };
                                
        // WEBSERVICE CALLBACK IF THE SERVICE IS UNAVAILABLE
        SafariDemo.prototype.OnWebServiceRequestComplete = function(result) {
            this.lastresult=result;
            alert("Complete: "+result);
        }
        SafariDemo.prototype.Echo = function() {
            BridgeCanada.Temp.Safari.HelloWorld.Echo(
            this.testtext,    
            {
               onMethodComplete: Function.createDelegate(this, this.OnWebServiceRequestComplete),
               onMethodTimeout: Function.createDelegate(this, this.OnWebServiceTimeOut),
               userContext: this
            } );
             
        }
        
        function DoEcho() {
            var val=document.getElementById("txtEcho").value;
            var demo=new SafariDemo(val);
            demo.Echo();
        }
        </script>


    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox runat="server" ID="txtEcho" Text="Hello There"></asp:TextBox>
            Click here to echo:
            
            <a href="http://forums.asp.net/AddPost.aspx?ForumID=1007#" onclick="javascript:DoEcho()">Echo Text</a>
        </div>
        </form>
    </body>
    </html>

     

     

Page 1 of 1 (1 items)