I am getting TypeError: e is undefined error message

I am getting TypeError: e is undefined error message

simflexsimflex Posts: 5Questions: 1Answers: 0
edited April 2014 in General
Hi,

I am in desparate need of help.

I have two tabs shown below:



Records
Details

...


Tab-1 deplays summary of user records. One of those records called ID is hyperlinked as shown in code snippet below:

[code] "aoColumns" : [

{ "mDataProp": "ID", "sWidth": "50px", sSortable: true,
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj)
{
// oObj.aData[0] returns the RequestID
return " " + oObj.aData["ID"] + " ";
}
},
{ mDataProp: "RequestDate", "sWidth": "100px", sSortable: true },
{ mDataProp: "RequestorFullName", "sWidth": "150px", sSortable: true },
{ mDataProp: "PrimarySiteContactDisplay", "sWidth": "250px", sSortable: true },
{ mDataProp: "RequestLocation", "sWidth": "150px", sSortable: true },
{ mDataProp: "RequestDescription", "sWidth": "200px", sSortable: true },
{ mDataProp: "RequestStatus", "sWidth": "100px", sSortable: true },

],
[/code]
When a user clicks on the ID link, details of the user's information is displayed in tab-2.

This works to a certain extent. It works because details get displayed in tab-2.

However, what is displayed comes out in json format, strainght from viewdetails.php file like this:

[code] [

{ "2012-09-24 15:43:56",

"white room",

"Arne",

"17"
},


{ "2012-09-24 15:43:56",

"white room",

"Arne",

"17"
}
]
[/code]

To display the records in html tabular format, I came up with the following:

[code]
$("#example").on("click", "a[target='tab']", function(){
var me = $(this);
var url = me.attr("href");
var tabName = me.data("tabName");
var tabIndex = parseInt(me.data("tabIndex"), 10);
$.get( url, function( data ) {
var table = $( '' ),
tr = $( '' ),
td = $( '' );
//add headers to the table
$.each( data.aaData, function(i,v) {
tr.clone().html( td.clone().html( v[0] ) )
.append( td.clone().html( v[1] ) )
.append( td.clone().html( v[2] ) )
.append( td.clone().html( v[3] ) )
.appendTo( table );
});
$( tabName ).html( table );
// Activate the tab once the page has loaded:
$("#tabs").tabs("option", "active", tabIndex);
}, 'json' );
// Prevent the browser from following the link:
return false;
});
[/code]
Now, when I click the ID link, I get the following error:

TypeError: e is undefined
...==t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"...

This is on line 4 of jquery.min.js.

Does anyone know how to resolve this error?

I am using version 2.0.3.

I am very desparate for a solution.

Thanks a lot in advance.

Replies

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Please link to a test case :-)

    Allan
  • simflexsimflex Posts: 5Questions: 1Answers: 0
    Hi Allan,

    Congratulations for a fantastic innovation!

    I can't link to a test case. The code points to viewdetails.php webservice that I can't access.
  • fmarzoccafmarzocca Posts: 3Questions: 1Answers: 0

    Hi simflex,

    I am getting the same error (I am working with tabs too). Just wondering if you have found a workaround for this.
    Thanks

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    @fmarzocca - can you give us a test case so we can try to debug and offer some help?

    Allan

This discussion has been closed.