-1

I have a application on VB.net and Java script, that is working fine in IE in compatibility mode but not working on Chrome.As i opened developer tool is shows messages like;

Uncaught NoModificationAllowedError: Failed to set the 'innerText' property on 'HTMLElement': The 'input' element does not support text insertion. TravelPolicy.aspx?PlanType=Individual:1783 captureEvents() is deprecated. This method doesn't do anything. releaseEvents() is deprecated. This method doesn't do anything. Uncaught NoModificationAllowedError: Failed to set the 'innerText' property on 'HTMLElement': The 'input' element does not support text insertion. TravelPolicy.aspx?PlanType=Individual:1905

This is my aspx page

<%@ Page Language="VB" AutoEventWireup="false" EnableEventValidation="false" CodeFile="TravelPolicy.aspx.vb"
    Inherits="Products_Travel_CODE_TravelPolicy" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="RJS.Web.WebControl.PopCalendar, Version=10.0.2512.14064, Culture=neutral, PublicKeyToken=815cf5007f7d0455"
    Namespace="RJS.Web.WebControl" TagPrefix="rjs" %>
<%@ Register Assembly="RJS.Web.WebControl.PopCalendar" Namespace="RJS.Web.WebControl"
    TagPrefix="rjs" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/Controls/wucAddress.ascx" TagName="wucAddress" TagPrefix="uc1_Cust" %>
<%@ Register Src="~/Controls/wucTravelAddress.ascx" TagName="wucTravelAddress" TagPrefix="uc1_Cover" %>
<%@ Register Src="~/Controls/wucHypothecationAddress.ascx" TagName="wucHypothecationAddress"
    TagPrefix="uc2" %>
<%@ Register TagPrefix="mbclb" Namespace="MetaBuilders.WebControls" Assembly="MetaBuilders.WebControls.CheckedListBox" %>
<!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 id="Head1" runat="server">
    <title>Untitled Page</title>
    <link href="../../../App_Themes/REL/Style.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/Verification/Style.css" type="text/css" rel="stylesheet" media="all" />
    
    <script type="text/javascript" src="../../../Script/print.js"></script>
   <%-- Added Later as u suggest--%>  
    <link rel="stylesheet" type="text/css" href="/admin/css/navigation.css" />

    <script language="vb" runat="server">    
    
        <System.Web.Services.WebMethod()> _
           Public Shared Function CheckPassportForBlackList(ByVal pass1 As String, ByVal pass2 As String, ByVal pass3 As String, ByVal pass4 As String, ByVal cookie As String) As String
            Dim ConsPassPort As String = ""
        
            If pass1 <> "" Then
                ConsPassPort = ConsPassPort + pass1 + ","
            End If
            If pass2 <> "" Then
                ConsPassPort = ConsPassPort + pass2 + ","
            End If
            If pass3 <> "" Then
                ConsPassPort = ConsPassPort + pass3 + ","
            End If
            If pass4 <> "" Then
                ConsPassPort = ConsPassPort + pass4 + ","
            End If
        
        
          
            Dim ChkVal As String = ""
            If ConsPassPort <> "" Then
                ConsPassPort = ConsPassPort.Substring(0, ConsPassPort.Length - 1)
            
                'Dim Momobj As New BlockedPassportStatusClient
                'Dim response As New Res_PassportDC
                Dim objComFun As New CommonFunctions
                Dim message As DataTable = New DataTable
            
                Try
                    'response = Momobj.StatusOfMultiBlockedPassport(ConsPassPort)
                    'message = response.DtPassport
                    message = objComFun.GetPassportBlockedStatusMultiple(ConsPassPort)
                Catch ex As Exception
                    ChkVal = ex.ToString
                    Return ChkVal
                End Try
            
                If message.Rows.Count > 0 Then
                    If message.Rows(0)(1).ToString().ToLower() = "true" Then
                        ChkVal = "This Passport Number  " + message.Rows(0)(0) + " is blocked.You can not issue Policy"
                    End If
                End If
                If message.Rows.Count > 1 Then
                    If message.Rows(1)(1).ToString().ToLower() = "true" Then
                        ChkVal = ChkVal + "This Passport Number  " + message.Rows(1)(0) + " is blocked.You can not issue Policy"
                    End If
                End If
                If message.Rows.Count > 2 Then
                    If message.Rows(2)(1).ToString().ToLower() = "true" Then
                        ChkVal = ChkVal + "This Passport Number " + message.Rows(2)(0).ToString() + " is blocked.You can not issue Policy"
                    End If
                End If
                If message.Rows.Count > 3 Then
                    If message.Rows(3)(1).ToString().ToLower() = "true" Then
                        ChkVal = ChkVal + "This Passport Number " + message.Rows(3)(0) + " is blocked.You can not issue Policy"
                    End If
                End If
            End If
            Return ChkVal
        End Function
    </script>

    <script type="text/javascript" language="javascript"> 


function checkTextAreaMaxLength(textBox,e, length)
{
}
More java script functions 


    </script>

    <script type="text/javascript" src="../../../Script/help.js"></script>
    
    <script type="text/javascript" src="/admin/js/textbox.js"></script>

   <%-- Added Later as u suggest--%>

</head >
</html>

Please help to fix this.

Code Uniquely
  • 6,356
  • 4
  • 30
  • 40
  • 1
    It seems like your application is relying on non-standard behavior from ancient IE versions. Chrome only supports standards mode, so you will need to update you application's code to work in Chome by the parts of it causing the errors you've posted. – Just Jake Feb 17 '15 at 08:12

2 Answers2

0

It should really only be considered to work if you can point a standard browser like chrome, Firefox, Safari and even IE in standards mode at it and it functions correctly. Saying you can only use IE and it has to be in compatibility mode and that "it works" doesn't make much sense. :)

The errors are showing you that that your are missing files at at locations (relative to the root of the site) that the application is trying to find and load (but they are not there 404 or cannot be served) these being;

/Admin/css/[name].css
/Admin/js/[name].js

Without your code I would assume that you build your project so that common things like text boxes scripts and general navigation styling would be in the root of your site (this may not be the case) at the relative locations of

/css 
/js

Could you check if your web server's virtual root /folder is pointing to the correct location on your machine and/or that all the files you are trying to load are in the right locations. After all the browser is only a doing a simple HTTP GET and if the files not there then it can't really download it.

try putting a very simple test.html file in the root of your web site with the following content (with appropriate paths)

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="/admin/css/navigation.css" />
  </head>
  <body>
    <h1>Hello</h1>
    <script src="/admin/js/textbox.js"></script>
  </body>
</html>

and see if they get loaded (if what you are asking for and your server is configured correctly then you should not get any 404's. This file is also so very simple that ANY browser (ancient or modern) should be able to provide this content ...

Code Uniquely
  • 6,356
  • 4
  • 30
  • 40
  • Not even in IE as you need compatibility mode and certainly not any other browser. IE doesn't even close to conforming to the W3C standards especially in compatibility mode. If the majority of the worlds browsers (including IE) can't use your application and a minority can if they break normal browser operations then I would humbly suggest that its not working. Get it working on all the others first (by using standards) then fix it for older IE after. Rather than building an app to use Compat Mode and forcing Quirks because even MS advise you not to do this for new applications. – Code Uniquely Feb 17 '15 at 09:26
  • my Java Script code are blocked in Chrome but in IE same is working fine, then what to do..?? please help – Shailendra Mishra Feb 17 '15 at 13:08
  • Is shouldn't be blocked its just a GET request and can you update your question to include the appropriate folder structures for you project include the main folder and the location of the, CSS, JS, fonts images and so on (don't want to know about each file, just the folders). Can you also give the test.html file that I describe in the answer above, a go and see what you get – Code Uniquely Feb 17 '15 at 16:14
  • As u suggest (Thanks) i changed folder structures. Now i'm getting only these error message.(Refer in question) – Shailendra Mishra Feb 18 '15 at 06:01
  • 1) it would be easier for you to get rid of all the "../../../../" stuff and put the path fixed and relative to the root of the site "/script/help.js" that way you know absolutely which code is used. 2) put the externally loaded scripts before your in-line scripts so that any code you right can make use of the externally loaded files. (in fact move your in-line code to a script if you can. 3) HTMLElement don't have text they have HTML mark-up you either need to use JQuery .html('content') or something like document.getElementById("id").innerHTML = "" – Code Uniquely Feb 18 '15 at 11:43
  • Also styles (so your CSS references) typically go in the section of the code but script (so all those script tags) usually go right at the bottom of the body of the code as per my example. This way the code DOM can apply styles from the CSS whilst the scripts are loading. and that the loading of the scripts doesn't block the general layout of the page from rendering. – Code Uniquely Feb 18 '15 at 11:49
0

Besides all the (valid) comments about the paths (I'd suggest you replace all the ../ with a ~/ so you'll end up with link href="~/App_Themes/REL/Style.css -- if your App-themes path is on the root)

And besides the valid comment from @Code Uniquely :

It should really only be considered to work if you can point a standard browser like chrome, Firefox, Safari and even IE in standards mode at it and it functions correctly. Saying you can only use IE and it has to be in compatibility mode and that "it works" doesn't make much sense. :)

We're all missing the point you're attempting to set the innerText property of an input control which is - as you can see in the error message - invalid. The input control has a value property, not an innertext. So, look at this one: Set the value of an input field and change your javascript accordingly.

It has nothing to do with your back-end code how horrifying it might be. It's plain standard javascript.

To stress the "IE compat mode" point: You can not rely on IE in compat mode for it "to be working fine".

  • If it's only working in IE compat mode it is broken.
  • If it's working for everything else and it also works in IE compat mode you got lucky.
Community
  • 1
  • 1
Leon
  • 919
  • 6
  • 21
  • OP updated the code to show a whole set of new error messages :) – Code Uniquely Feb 18 '15 at 11:54
  • This one: ""Uncaught NoModificationAllowedError: Failed to set the 'innerText' property on 'HTMLElement': The 'input' element does not support text insertion."" ? – Leon Feb 18 '15 at 11:55
  • I just added IE tab in chrome , now it is working fine. Now help me ... I want to check whether IE TAB plugin is already added or not in Browser at run time on page load. My application is in VB.net. – Shailendra Mishra Feb 20 '15 at 06:22
  • *auch* NO! why don't you rewrite your javascript code to be *valid* on all browsers? Like I said: it has nothing(!) to do with your backend code it's a javascript error which is (incorrect) allowed on *OLD* IE versions. Don't go there. Rewrite your javascript - don't rely on plugins. – Leon Feb 20 '15 at 12:02