Unable to Get Value of the Property nodeType While Using Knockout

When I started using knockout.js in my applications I became excited to see the many uses of this library.  It took me a little bit of time to realize how to implement it.  One reason it took me a while was when I came across this error.

Unable to get value of the property nodeType

I checked and rechecked my syntax and spent several days trying to find the problem.  Come to find out it was a simple solution.  Although you can get this error for many reasons one of the easiest reasons is that your code file that initializes the knockout.js binding is trying to load before the knockout library has completely loaded.  So if you move your binding towards the end of the page while loading the knockout.js library near the top, this is generally enough time for everything to load appropriately.

This is just a quick resolution to a simple problem.  An example is below.

<br />
<!DOCTYPE html><br />
<head><br />
    <title></title><br />
    <script src="jquery-1.8.3.min.js"></script><br />
    <script src="knockout-latest.js"></script><br />
</head></p>
<p><body><br />
    <form id="form1" runat="server"><br />
    <div><br />
     ..........Code................<br />
    </div><br />
    </form></p>
<p>    <script src="dropdown.js"></script><br />
</body></p>
<p></html><br />

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , | Posted under ASP .NET 4.0 | RSS 2.0

Author Spotlight

David Bauernschmidt

David Bauernschmidt

I live in the historical triangle of Virginia where I am married with two daughters. I have spent over 13 years working for a Fortune 500 company in the computer area. I started in VB 6.0 and by the time I ended my employment I was supervising a development team where we built many web applications. When my first daughter was born I wanted to spend more time with her so I left and became a programmer analyst for local government as well as launch my own company. Since then I have grown James River Webs into a profitable web design and application company helping small businesses create a big presence on the internet. As an employee I have created web application used by citizens and other companies. I enjoy fly fishing, and spending time with my family. I also enjoy learning new approaches and development tools when it comes to developing applications.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 6 = 9

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>