Donate

Object doesn't support property or method call in consuming JSON object From ASP.NET MVC In Internet Explorer

Recently,
I've followed a simple tutorial regarding consuming JSON object in ASP.NET MVC. The error stated from the title of this post appears in IE9. The original snippet is this:
  $(document).ready(  
      $.getJSON(  
        'http://localhost:6222/home/customerjson',  
         function (item) {  
           $('#result') //show product name in   
            .html('<p>' + item.CurrentCustomer.CustomerName + '</p>');  
         }  
      )  
    );  
The solution is to enclose $.getJSON() in a function() statement based from the modified code below. The popup script just went away.
  $(document).ready(function(){  
        $.getJSON(  
          'http://localhost:6222/home/customerjson',  
           function (item) {  
             $('#result') //show product name in   
              .html('<p>' + item.CurrentCustomer.CustomerName + '</p>');  
           }  
        )  
      });   
Cheers!

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

Pass GUID As Parameter To Action Using ASP.NET MVC ContribGrid