Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Microsoft JScript runtime error: Object doesn't support this propety or method.

Posted on 2012-03-16
2
1,494 Views
Last Modified: 2012-03-18
I'm working on a new website using ASP.NET MVC 3 and JQuery. I actually started with the HTML 5 Mobile ready website template that's available on NuGet.

I trying to use JQuery.sparkliine.js library to do some charting. When I run it in Visual Studio 2010 I get the error in the: Microsoft JScript runtime error: Object doesn't support this propety or method. and it stops at this line....

             $('.inlinesparkline').sparkline();


<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8 ]>    <html class="ie ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--><html class="no-js" lang="en"><!--<![endif]-->
<!--[if lt IE 9]>
<script src="@Url.Content("~/Scripts/html5.js")"></script>
<![endif]-->
<!-- the "no-js" class is for Modernizr. -->

<head>
   <meta charset="utf-8">
	
	<meta name="description" content="The content description">
   <link rel="shortcut icon" href="@Url.Content("~/Content/images/favicon.ico")">
	

    <title>@ViewBag.Title</title>
@*    <link href="@Url.Content("~/css/Html5Reset.css")" rel="stylesheet"/>
*@    <link href="@Url.Content("~/css/Site.css")" rel="stylesheet"/>
      
     <!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.js"></script>
<script> window.jQuery || document.write(unescape("%3Cscript src='@Url.Content("~/Scripts/jquery-1.6.2.min.js")'%3E%3C/script%3E"))</script>
  
    <script src="@Url.Content("~/Scripts/modernizr-2.0.6.js")"></script>
    <script src="@Url.Content("~/Scripts/jquery.sparkline.js")"></script>
    
     <script type="text/javascript">
         $(function () {
             /** This code runs when everything has been loaded on the page */
             /* Inline sparklines take their values from the contents of the tag */
             $('.inlinesparkline').sparkline();

             /* Sparklines can also take their values from the first argument 
             passed to the sparkline() function */
             var myvalues = [10, 8, 5, 7, 4, 4, 1];
             $('.dynamicsparkline').sparkline(myvalues);

             /* The second argument gives options such as chart type */
             $('.dynamicbar').sparkline(myvalues, { type: 'bar', barColor: 'green' });

             /* Use 'html' instead of an array of values to pass options 
             to a sparkline with data in the tag */
             $('.inlinebar').sparkline('html', { type: 'bar', barColor: 'red' });
         });
    </script>

</head>

<body id="page">
   <!-- Begin the page section with the section tag -->

   
<p>
Inline Sparkline: <span class="inlinesparkline">1,4,4,7,5,9,10</span>.
</p>
<p>
Sparkline with dynamic data: <span class="dynamicsparkline">Loading..</span>
</p>
<p>
Bar chart with dynamic data: <span class="dynamicbar">Loading..</span>
</p>
<p>
Bar chart with inline data: <span class="inlinebar">1,3,4,5,3,5</span>
</p>

      <!-- body of the pages should start with section class="content" -->      

@RenderBody()

        <footer id="pageFooter"> <!--begin master footer -->
          
           <h4 class="stylishHeader">@Html.Raw( string.Format("{0} {1} {2}" ,"&copy;",DateTime.Now.Year,"Xoikos.com"))</h4> 
           
@*           <a href="http://www.w3.org/html/logo/" class="nobg">
<img src="http://www.w3.org/html/logo/badge/html5-badge-h-connectivity-css3-device-graphics-multimedia-performance-semantics-storage.png" width="357" height="64" alt="HTML5 Powered with Connectivity / Realtime, CSS3 / Styling, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage" title="HTML5 Powered with Connectivity / Realtime, CSS3 / Styling, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage">
</a>*@
           
        </footer><!--end master footer -->
            
		
    <!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.6.2.min.js"></script>
<script> window.jQuery || document.write(unescape("%3Cscript src='@Url.Content("~/Scripts/jquery-1.6.2.min.js")'%3E%3C/script%3E"))</script>

   @RenderSection("scripts",false)
   
</body>
</html>

Open in new window

0
Comment
Question by:dgerler
2 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 37732429
You load an old jQuery, then you test if jQuery is loaded - if not you then load a NEWER jQuery???

Why not just load

http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js

then you always get the latest

Also Modernizr is version 2.5.3

That said, sparklines is 2010 so perhaps it does not want the latest stuff and this question may even have nothing to do with jQuery but more to do with visual studio of which I have no knowledge
0
 

Author Closing Comment

by:dgerler
ID: 37735565
Looks like the problem was where I was loading more than one JQuery version.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question