jquery IE uploadify对象不支持属性或方法

时间:2017-08-02 10:17:38

标签: javascript jquery asp.net

我正在使用tinymce和uploadify创建一个允许用户上传附件的电子邮件屏幕。 它在chrome和我使用的IE 10版本上运行良好。

然而,IE 10和11的其他版本不能按预期工作。屏幕缩小并截断文本。

阅读其他类似的错误建议更改jquery版本1.7.2 所以我尝试了其他版本,但这导致了tinymce菜单消失。 这似乎是由物业现场引起的,我用它取而代之。 菜单返回。

但是现在我得到fileupload对象不支持属性或方法。 一个建议是用/&gt;替换</script>但这只会让tinymce菜单再次消失。

关于如何让这些代码在IE上运行而没有错误的任何想法?

`<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm19.aspx.vb" Inherits="CaseManagementTest.WebForm19" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
 <title></title>
</head>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <style type="text/css">
        TD { FONT: 12pt verdana }
            .style9
            {
                width: 146px;
            }
    </style>

  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" ></script>
  <script type="text/javascript" src="tinymce/js/tinymce/tinymce.min.js" ></script>
  <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" ></script>
  <script  type="text/javascript" src="Scripts/jquery.uploadify.js" ></script> 
  <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css" rel="stylesheet" type="text/css" />


    <script type="text/javascript">
        $("#btnLookup").on("click", function () {
            $("#popup").dialog({
                title: "Email Address",
                Width: 600
            })
            return false;
        });

        tinymce.init({
            selector: ".tinymce",
            theme: "modern",
            menubar: false,
            resize: false,
            statusbar: false,
            plugins: ["advlist autolink lists charmap preview hr anchor",
            "pagebreak code nonbreaking table contextmenu directionality paste"],
            toolbar1: "styleselect | bold italic underline | pagebreak code preview | undo redo",
            toolbar2: "fontselect | fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"
        });

        </script>

    <script type="text/javascript">
        $(function () {
            $("[id*=FileUpload1x]").FileUpload ( {
                'uploader': 'scripts/uploader.swf',
                'cancelImg': 'Content/themes/base/images/cancel.png',
                'buttonText': 'Attach Files',
                'script': 'UploadVB.ashx',
                'folder': 'uploads',
                'multi': true,
                'auto': true,
                'scriptData': { key: '<%=Key %>' },
                'onSelect': function (event, ID, file) {
                    $('#btnSendx0').prop('disabled', true)
                    $("#attachedfiles tr").each(function () {
                        if ($("td", this).eq(0).html() == file.name) {
                            alert(file.name + " already uploaded.");
                            $('#btnSendx0').prop('disabled', false);
                            $("[id*=FileUpload1x]").fileUploadCancel(ID);
                            return;
                        }
                    });
                },
                'onComplete': function (event, ID, file, response, data) {
                    $('#btnSendx0').prop('disabled', false);
                    $("#attachedfiles").append("<tr><td>" + file.name + "</td><td><a href = 'javascript:;'>[x]</a></td></tr>");
                }
            });
        });

        $("#attachedfiles a").on("click", function () {
            var row = $(this).closest("tr");
            var fileName = $("td", row).eq(0).html();
            $.ajax({
                type: "POST",
                url: "VB.aspx/RemoveFile",
                data: '{fileName: "' + fileName + '", key: "<%=Key %>" }',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function () { },
                failure: function (response) {
                    alert(response.d);
                }
            });
            row.remove();
        });

        $(function () {
            $("[id*=button1]").click(function () {
                ShowPopup();
                return false;
            });
        });
        function ShowPopup() {
            $("#dialog").dialog({
                title: "Email Addresses",
                width: 650,
                buttons: {
                    Exit: function () {
                        $(this).dialog('close');
                    }
                },
                modal: true
            });
        }
    </script>

     <script type="text/javascript">
         function CloseWindow() {
             window.close();
             window.opener.location = window.opener.window.location;
         }
    </script>

   <body >
    <form id="form1" runat="server">
      <div id="dialog" style="display: none">
      <asp:Label ID="lbl1" Text="Selected" runat="server" ></asp:Label>
      <asp:TextBox id="selectedEmail" runat="server" Width="600px" ></asp:TextBox>
      <asp:GridView ID="GridView1" runat="server" Width="600px" AutoGenerateColumns="false"  OnSelectedIndexChanged = "OnSelectedIndexChanged" OnPageIndexChanging="OnPageIndexChanging" 
            PageSize="10" AllowPaging="true">
            <Columns>
            <asp:BoundField  DataField="cn" HeaderText="Name"  />
            <asp:BoundField DataField="telephoneNumber" HeaderText="Tele"  />
            <asp:BoundField  DataField="mail" HeaderText="Email"  />
            <asp:ButtonField Text="Select" CommandName="Select" />
            </Columns>
        </asp:GridView>
    </div>
 <asp:Button ID="Button1" runat="server" Text="Button" style = "display:none"  />
        <center>
     <div style="FONT:700 20pt arial; COLOR:navy">Email</div>
        <hr/>

    <div>
        <table border = "0" style="width: 409px">


            <tr>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="Email*"></asp:Label><br />
                </td>
                <td align="left" colspan="4">
                    <asp:TextBox ID="txtEmail" runat="server"  TextMode="MultiLine"  Width="600px" ></asp:TextBox><br />
                    <asp:RegularExpressionValidator id="valRegEx" runat="server" ValidationGroup="contactX"
                    ControlToValidate="txtEmail"
                    ValidationExpression=".*@.*\..*"
                    ErrorMessage="*Invalid Email address."
                    display="dynamic">
                    </asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ValidationGroup="contactX" ErrorMessage="* Required" 
                    ControlToValidate = "txtEmail"></asp:RequiredFieldValidator>
                </td>

            </tr>
            <tr><td></td>
            <td align="left"><asp:TextBox ID="lookup" runat="server" />

                    <asp:Button ID="Button2" runat="server" Text="lookUp"  ValidationGroup="look"  OnClick="btnlookup_Click"/>
                     <asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" ValidationGroup="look"
                    ControlToValidate="lookup"
                    ValidationExpression="^[a-zA-z]{2,100}$"
                    ErrorMessage="* ."
                    display="dynamic">
                    </asp:RegularExpressionValidator>
               </td>
             <td><asp:TextBox ID="email_or_cc" runat="server" Visible="false"  /></td>



            <tr>
           <td>
                    <asp:Label ID="Label1" runat="server" Text="CC*"></asp:Label><br />
                </td>
                <td align="left" colspan="4">
                    <asp:TextBox ID="txtcc" runat="server" TextMode="MultiLine"  Width="600px" ></asp:TextBox><br />
                    <asp:RegularExpressionValidator id="RegularExpressionValidator2" runat="server" ValidationGroup="contactX"
                    ControlToValidate="txtcc"
                    ValidationExpression=".*@.*\..*"
                    ErrorMessage="*Invalid Email address."
                    display="dynamic">
                    </asp:RegularExpressionValidator>

                </td>
            </tr>

            <tr><td></td>
            <td align="left"><asp:TextBox ID="ccemail" runat="server" />

                    <asp:Button ID="Button3" runat="server" Text="CC lookUp"  ValidationGroup="look"  OnClick="btnlookup_ClickX"/>
                     <asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ValidationGroup="look"
                    ControlToValidate="lookup"
                    ValidationExpression="^[a-zA-z]{2,100}$"
                    ErrorMessage="* ."
                    display="dynamic">
                    </asp:RegularExpressionValidator>
               </td>
             <tr>
          <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Subject*"></asp:Label><br />
                </td>
                <td align="left" colspan="4">
                    <asp:TextBox ID="txtSubject" runat="server" Width="600px" ></asp:TextBox><br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="contactX" ErrorMessage="* Required" 
                     ControlToValidate = "txtSubject"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td valign = "top" class="style9" >
                    <asp:Label ID="Label4" runat="server" Text="Body*"></asp:Label>
                </td>
                <td class="style9" colspan="4">
                    <asp:TextBox ID="txtBody" runat="server" CssClass="tinymce" TextMode = "MultiLine"  Height="355px" Width="600px" ></asp:TextBox><br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ValidationGroup="contactX" ErrorMessage="* Required" 
                    ControlToValidate = "txtBody"></asp:RequiredFieldValidator>
                </td>
            </tr>
             <tr>
                <td></td>
                <td colspan="4">
                    <asp:FileUpload ID="FileUpload1x" AllowMultiple="true" runat="server" />
               </td>
            </tr>

             <tr>
            <td>
            </td>
            <td colspan="2">
                <table id = "attachedfiles">
                </table>
            </td>
        </tr>
              <tr>
                 <td>&nbsp;</td>
                 <td>
                    <asp:Button ID="btnSendx0" runat="server" Text="Send" ValidationGroup="contactX" onClientClick="tinyMCE.triggerSave(false,true)" OnClick="btnSend_Click"  />
                         &nbsp; &nbsp;
                         <asp:Button ID="btnBack" Text="Back" runat="server" OnClientClick="CloseWindow()" ValidationGroup="contactX"   CausesValidation="false" />&nbsp;

               </td>
                  <td>
                    &nbsp;</td>

            </tr>
            <tr>
                <td></td>
                <td colspan="4">
                    <asp:Label ID="lblMessage" runat="server" Text="" ForeColor = "Green"></asp:Label>
               </td>
            </tr>
         </table>
    </div>
    <asp:TextBox ID="txtName" Visible="false" ReadOnly="true" runat="server" ValidationGroup="contactX"   ></asp:TextBox>
     </center>
 <center>
 </center>
   </form>
</body>
</html> 

`

0 个答案:

没有答案