[CLOSED] Javascript Error

  1. #1

    [CLOSED] Javascript Error

    I am experienceing a javascript error in the loading and initilization of the resource. Specifically, the error is this: "p is null","http://localhost:1858/extjs/ext-all-js/ext.axd?v=13055",21

    I don't know when the error started or if it is because I am not initializing something correctly, but how would you suggest that I go about debugging this in the most effective manner since the javascript is compressed and obsfucated? I used jsbeautifier to make the code readable and found this (at line 30):

    Ext.apply = function (o, n, q) {
            if (q) {
                Ext.apply(o, q)
            }
            if (o && n && typeof n === "object") {
                var p, m, l;
                for (p in n) {
                    o[p] = n[p]
                }
                if (b) {
                    for (m = b.length; m--;) {
                        l = b[m];
                        if (n.hasOwnProperty(l)) {
                            o[l] = n[l]
                        }
                    }
                }
            }
            return o
    but I am not sure where to go from here. What do you suggest?
    Last edited by Daniil; Jun 21, 2012 at 9:50 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I can't see the line #30 in the code.
    Quote Originally Posted by adelaney View Post
    I used jsbeautifier to make the code readable and found this (at line 30):

    Ext.apply = function (o, n, q) {
            if (q) {
                Ext.apply(o, q)
            }
            if (o && n && typeof n === "object") {
                var p, m, l;
                for (p in n) {
                    o[p] = n[p]
                }
                if (b) {
                    for (m = b.length; m--;) {
                        l = b[m];
                        if (n.hasOwnProperty(l)) {
                            o[l] = n[l]
                        }
                    }
                }
            }
            return o
    I can suggest:

    1. Set up
    <ext:ResourceManager runat="server" ScriptMode="Debug" />
    on the page or
    <extnet scriptMode="Debug" />
    in Web.config.

    It will cases the JS "debug" (well-formatted) scripts will be loaded.

    2. Use VisualStudio + Internet Explorer to debug JavaScript. Internet Explorer can catch the JavaScript error and you can use Visual Studio instance to debug.
  3. #3
    I have a little more information, but hoping you can help some more. It appears that the error is here:
    "url is null","http://localhost:1858/extjs/ext-all-debug-js/ext.axd?v=13055",813

    urlAppend : function(url, string) {
                if (!Ext.isEmpty(string)) {
                    return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
                }
    
                return url;
            },
    It doesn't impede the processing fo the rest of the script. However, I don't know what is calling this function. Can you give me a hint as to what may call this bit of code? It seems that the grid is what is triggering the error, as removing the grid eliminates the error. However, as stated, it doesn't prevent the grid from displaying. Any ideas?
  4. #4
    I guess you have something like this:
    <ext:Panel runat="server">
        <Loader runat="server" Mode="Frame" />
    </ext:Panel>
    So, the Loader with no Url.

    If yes, please set up
    AutoLoad="false"
    for the Loader.

    Example

    <ext:Panel runat="server">
        <Loader runat="server" Mode="Frame" AutoLoad="false" />
    </ext:Panel>
  5. #5
    I didn't have exaclty what you described, but I had this:
    .Loader(New Ext.Net.ComponentLoader() With {.Enabled = True, .ClientIDMode = ClientIDMode.Static, .AutoLoad = True, .AutoDataBind = True, .Mode = LoadMode.Data}) _
    As you can see, I did have the autoload set to true. I changed it to false, and the error is resolved. Since I have URLs set up in the proxy, I am not sure why it was throwing a URL error. Will you explain that to me?

    Thanks for the help.
  6. #6
    I am not sure what proxy do you mean
    Loader is not related with any proxy. You have to define url or direct method for loader

    Which widget is used that Loader?
  7. #7
    Hmm....Ok. I guess I don't fully understand how everything gets transferred back and forth. The loader is for a grid. The grid has a proxy set up for its store. The grid also has some complex filtering that we chose to do outside of the grid functionality as it was too complex via javascript and so we simply opted for Ajax calls back to the controller and then reload the grid "from scratch," which is why the loader became necessary, if I am not mistaken - it was a support/tech help item from you guys.



    Here is the store and loader:

    .
    Store(Sub(str)
                                                             str.Add(Html.X.Store().ID("tmStore").AutoLoad(True) _
                                                                     .Model(Sub(mdl)
                                                                                mdl.Add(Html.X().Model.Fields(Sub(fields)
                                                                                                                  fields.Add(Html.X.ModelField.Name("CWTeamID").Type(ModelFieldType.Int))
                                                                                                                  fields.Add(Html.X.ModelField.Name("Name"))
                                                                                                                  fields.Add(Html.X.ModelField.Name("DrafterEmployeeID").Type(ModelFieldType.Int))
                                                                                                                  fields.Add(Html.X.ModelField.Name("ReviewerEmployeeID").Type(ModelFieldType.Int))
                                                                                                                  fields.Add(Html.X.ModelField.Name("CorrespondentEmployeeID").Type(ModelFieldType.Int))
                                                                                                                  fields.Add(Html.X.ModelField.Name("QAReviewerEmployeeID").Type(ModelFieldType.Int))
                                                                                                              End Sub).ID("mdlTeam").Name("mdlTeam"))
                                                                            End Sub) _
                                                                      .Proxy(Sub(proxy)
                                                                                 Dim prxy As New Ext.Net.AjaxProxy()
                                                                                 With prxy
                                                                                     .API.Create = Url.Content("~/Assignments/_AddTeam/")
                                                                                     .API.Read = Url.Content("~/Assignments/_GetTeams/") + MvcApplication.CurrentApplicationUser.EmployeeID.ToString()
                                                                                     .API.Update = Url.Content("~/Assignments/_EditTeam")
                                                                                     .API.Destroy = ""
                                                                                     .Json = True
                                                                                     .Reader.Add(New Ext.Net.JsonReader() With {.Root = "Data", .AutoDataBind = True})
                                                                                 End With
                                                                                         
                                                                                 proxy.Add(prxy)
                                                                             End Sub) _
                                                                     .RemotePaging(False) _
                                                                     .PageSize(15))
                                                         End Sub) _
                                                     .Loader(New Ext.Net.ComponentLoader() With {.Enabled = True, .ClientIDMode = ClientIDMode.Static, .AutoLoad = False, .AutoDataBind = True, .Mode = LoadMode.Data}) _
    As may be obvious, we use the proxy calls for the adding/editing of records. Hopefully, this makes sense. If not, I can try to clarify more.
  8. #8
    Quote Originally Posted by adelaney View Post
    if I am not mistaken - it was a support/tech help item from you guys.
    I don't think so. Or, maybe, there is some misunderstanding.

    GridPanel should gets its data from the Store. And I don't think using the Loader for GridPanel is a good approach.

    Please clarify the initial requirement with more details. Maybe, we could suggest something better.

Similar Threads

  1. [CLOSED] IE8 javascript error
    By Edward in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 20, 2010, 7:16 PM
  2. [CLOSED] [1.0] Javascript Error in IE8
    By Ben in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 21, 2010, 4:10 PM
  3. [CLOSED] Javascript Error?
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 15, 2009, 12:43 PM
  4. [CLOSED] javascript error
    By alexp in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Mar 12, 2009, 10:59 AM
  5. [CLOSED] SVN JavaScript error
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 11, 2008, 6:53 PM

Tags for this Thread

Posting Permissions