Click here to Skip to main content
13,201,892 members (67,291 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
I follow the tutorial here exactly but I keep getting this error:

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'jtable'

Any idea how to resolve it?

Here is my header:
 <script type="text/javascript" src="/Scripts/jquery-1.8.3.js">
        </script>
 
        <script type="text/javascript" src="/Scripts/jquery-ui-1.9.2.js">
        </script>
 
        <link href="/Scripts/jtable/themes/standard/green/jtable_green.css" 
              rel="stylesheet" type="text/css" />
 
        <script type="text/javascript" src="/Scripts/jtable/jquery.jtable.js">
        </script>
Posted 8-Jan-13 8:41am
Zumicts521

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Clearly either one of these files is not there, or your code is just wrong. The browser cannot tell you're using MVC, and the fact that you are, makes no difference to how you write client side script
  Permalink  
Comments
Zumicts 8-Jan-13 14:48pm
   
You're answer is 50% unrelevent to what I've ask. To recap my question is: "Any idea how to resolve it?" not "Does it make a different if I'm using MVC".
Christian Graus 8-Jan-13 14:50pm
   
That's right, I added some more information b/c you seem to have no idea how MVC works or what it does. The only possible answer is, make sure the file is there, and if it is, and if it's being loaded ( check in Chrome ), then the code you DIDN'T post has the issue. We can't fix code we can't see.
Zumicts 8-Jan-13 14:56pm
   
Thhe title tries to reference the tutorial here on CodeProject that I use.
Zumicts 8-Jan-13 14:49pm
   
The files are indeed there. Because I can track the progress when it's loading them. JQuery and Jquery UI are fine. JTable also, as it's not getting any error; unless I load it before JQuery UI.
Christian Graus 8-Jan-13 14:50pm
   
So, your code is broken. You didn't show us the broken code.
Zumicts 8-Jan-13 14:55pm
   
Here is the whole code (razor file):

@{
ViewBag.Title = "Products";
}

Products



<script type="text/javascript" src="/Scripts/jquery-1.8.3.js">
</script>

<script type="text/javascript" src="/Scripts/jquery-ui-1.9.2.js">
</script>

<link href="/Scripts/jtable/themes/standard/green/jtable_green.css"
rel="stylesheet" type="text/css" />

<script type="text/javascript" src="/Scripts/jtable/jquery.jtable.js">
</script>



<div id="PersonTableContainer"></div>

<script type="text/javascript">
$(document).ready(function () {
$('#PersonTableContainer').jtable({
title: 'Table of people',
actions: {
listAction: '/GettingStarted/PersonList',
createAction: '/GettingStarted/CreatePerson',
updateAction: '/GettingStarted/UpdatePerson',
deleteAction: '/GettingStarted/DeletePerson'
},
fields: {
PersonId: {
key: true,
create: false,
edit: false,
list: false
},
Name: {
title: 'Author Name',
width: '40%'
},
Age: {
title: 'Age',
width: '20%'
},
RecordDate: {
title: 'Record date',
width: '30%',
type: 'date',
create: false,
edit: false
}
}
});

$('#PersonTableContainer').jtable('load');
});
</script>
Zumicts 8-Jan-13 14:59pm
   
And here it is in action:

http://rocksolidapi.cloudapp.net/manage/products
Christian Graus 8-Jan-13 14:58pm
   
The instructions say to put the includes in the head, not the body. For all that, I agree that this should work, based on the docs. I'd download the demos at http://www.jtable.org/Home/Downloads and run those, and then try to work out why your code is different. Might you be using a newer version of jquery that breaks this library ?
Zumicts 8-Jan-13 15:03pm
   
Yes, it may be that Im using newer version of jquery. Will downgrade and see if it works...
Christian Graus 8-Jan-13 15:06pm
   
Like I said, I would download the examples and compare them for differences, but I suspect that could be it. I ran the code in Chrome and I can see the error, there's another file that has a ton of js errors, too, so I reckon that's where the problem lies.
Zumicts 8-Jan-13 15:11pm
   
Fianlly fix it. Change it to the header and I forgot to removed the old version of JQuery. Now its functioning properly.
Christian Graus 8-Jan-13 15:12pm
   
*grin* awesome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.171020.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100