Ошибка выполнения microsoft jscript json определение отсутствует

  • Home
  • VBForums
  • .NET and More
  • ASP.NET And ASP.NET Core
  • VS 2010 [RESOLVED] Microsoft JScript runtime error: ‘JSON’ is undefined

  1. Jun 21st, 2011, 08:17 PM

    #1

    Resolved [RESOLVED] Microsoft JScript runtime error: ‘JSON’ is undefined

    I am using Windows 7 PRO, 64 bit, with Internet Explorer 8, Visual Studio 2010

    Every time I run any ASP.NET application in debug mode, right after it loads any of the pages, then I get 2 errors:

    Error: Microsoft JScript runtime error: ‘JSON’ is undefined

    Name:  Err1.jpg
Views: 14671
Size:  113.4 KB

    I click «Ignore» error, then I get this: Microsoft JScript runtime error: ‘undefined’ is null or not an object

    Name:  Err2.jpg
Views: 14447
Size:  165.4 KB

    And the file is from Internet Explorer:
    Name:  Err3.jpg
Views: 14117
Size:  23.1 KB

    Anyone know how to fix this ?

    Last edited by CVMichael; Jun 21st, 2011 at 08:42 PM.


  2. Jun 21st, 2011, 08:55 PM

    #2

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Where is that JSON defined? If its in some library, are the required js files included?


  3. Jun 21st, 2011, 08:59 PM

    #3

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    I have no idea… I think it’s part of the IE8…

    I kind of fixed the problem, I disabled «Active scripting»

    Name:  Err4.jpg
Views: 14226
Size:  118.9 KB

    And now I don’t get those errors, but I have no idea what are the consequences of disabling that option from IE.

    I am google-ing it right now…

    Last edited by CVMichael; Jun 21st, 2011 at 10:59 PM.


  4. Jun 21st, 2011, 10:52 PM

    #4

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    I was afraid of that… Now, none of the javascripts executes, so I had no choice but to re-enable active scripting


  5. Jun 24th, 2011, 12:42 AM

    #5

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    I still have this problem

    Very annoying… I have to click on «Ignore» error for any button (or link) I click on my web pages…


  6. Jun 24th, 2011, 12:57 AM

    #6

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Hello,

    I can’t say that I have seen this problem, no.

    Does this happen on every web page, and web application that you debug out of Visual Studio? Or is it only one? If it is, what is different about that site?

    Gary


  7. Jun 24th, 2011, 01:09 AM

    #7

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    It’s on any page, any app, even when I just create a new app and don’t write any code, and just run it, as soon as it opens in IE, it gives me those 2 errors.

    And only in Debug mode… If I just build the app, then go to IE, and type the http://localhost/TestApp link, then I don’t get any errors (in IE).


  8. Jun 24th, 2011, 01:15 AM

    #8

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Hmm, very strange.

    Okay, so obvious questions first…

    Have you tried setting your default browser from Visual Studio to another browser? Does the same thing happen?

    Have you got all updates to Visual Studio?

    Have you got all updates to Windows?

    Is there any possibility that you have any viruses/spyware lurking on your machine?

    Gary


  9. Jun 24th, 2011, 01:27 AM

    #9

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    «Have you tried setting your default browser from Visual Studio to another browser? Does the same thing happen?»
    With Internal Browser, no errors (but for some reason it does not debug)
    With FireFox no errors (but does not debug)
    Safari, no errors (but does not debug)
    So it seems only in IE, and it seems like it’s the only one that I can debug

    «Have you got all updates to Visual Studio?»
    No… how do you do that ? (I’ll google it…)

    «Have you got all updates to Windows?»
    Yes…

    «Is there any possibility that you have any viruses/spyware lurking on your machine?»
    I have AVG antivirus, that has anti-spyware also…
    Also… the errors don’t seem like spyware to me…

    Last edited by CVMichael; Jun 24th, 2011 at 01:30 AM.


  10. Jun 24th, 2011, 01:30 AM

    #10

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    To get the latest updates for Visual Studio, and any other Microsoft Product on your machine, make sure that you are using Microsoft Update, rather than Windows Update.

    Ok, so this definitely sounds like a problem with IE then. Are you running any additional addins/extensions for IE? For instance, any additional toolbars?

    Have you done a full scan with each of those packages lately? Might be good to do, just to rule it out.

    Gary


  11. Jun 24th, 2011, 01:39 AM

    #11

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    I am downloading VS2010 SP1 ISO right now (ISO because I want to have it for the future so I don’t have to download it again)

    Quote Originally Posted by gep13
    View Post

    …with each of those packages lately?…

    What do you mean by that ?


  12. Jun 24th, 2011, 01:44 AM

    #12

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Sounds like a plan.

    I mean, have you downloaded all the recent virus and spyware updates, and ran a full virus scan and a full spyware scan of your computer lately?

    Gary


  13. Jun 24th, 2011, 01:50 AM

    #13

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Ow… I see…
    I started a «Full computer scan», it’s still in progress, nothing unusual yet…

    [edit]
    The scan is complete, no infections, perfectly clean…

    Last edited by CVMichael; Jun 24th, 2011 at 02:01 AM.


  14. Jun 24th, 2011, 02:09 AM

    #14

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Hmmm, very strange.

    What about clearing out Internet Explorer Temporary Internet Files?

    I am starting to clutch at straws here It is definitely something with IE, but not sure what else it could be. The only other thing I could suggest would be to try this:

    http://www.piriform.com/CCLEANER

    Gary


  15. Jun 24th, 2011, 02:43 AM

    #15

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Thanks for all your help Gary,

    I have finished downloading SP1, but it’s very late for me, I will continue tomorrow to install it, and hopefully it will fix the problem.


  16. Jun 24th, 2011, 02:48 AM

    #16

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    I was going to say, surely you should be grabbing some zzzz’s by now

    Let me know how you get on.

    Gary


  17. Jun 24th, 2011, 05:40 PM

    #17

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    I installed SP1, and also I ran CCleaner, and no change, same problem


  18. Jun 25th, 2011, 03:12 AM

    #18

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    Unfortunately, I am fresh out of ideas, sorry

    Gary


  19. Jun 26th, 2011, 12:24 AM

    #19

    Re: Microsoft JScript runtime error: ‘JSON’ is undefined

    FINALLY !!! I found the solution…

    I was going through this thread:
    http://www.sharkyforums.com/showthread.php?t=321706

    In the second-last post, there is a link to the solution:
    http://winmike.blogspot.com/2011/01/…after-you.html

    So, disabling DivX Add-on fixed my problem, no more annoying errors when debugging my apps.


  20. Jun 26th, 2011, 04:32 AM

    #20

    Re: [RESOLVED] Microsoft JScript runtime error: ‘JSON’ is undefined

    Wow!

    Very strange! Glad to hear that you got a solution!

    Gary


  • Home
  • VBForums
  • .NET and More
  • ASP.NET And ASP.NET Core
  • VS 2010 [RESOLVED] Microsoft JScript runtime error: ‘JSON’ is undefined


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules


Click Here to Expand Forum to Full Width

Выполняю код.

    //_ТекстСкрипта;

    Скрипт = СоздатьОбъект(«MSScriptControl.ScriptControl»);

    Скрипт.Language = «JScript»;

    Скрипт.AddCode(_ТекстСкрипта);    

    Скрипт.Run(«init»);

ТекстСкрипта равен

var socket;

var isConnect = false;

function errorConnectDefault(data) { alert(data);}

var errorConnectCallBack = errorConnectDefault;

    function init() {

        connectTumSocket1(«7kaIenL3KzdAEgPVeXqtgOPwJEPTm558GMesUET+60JKxNzwG0JcEl97Vs+jE/A8WAzDGr1xkYoPvbaHGYVRDw==», function (event) {

            var options = {«apiKey»: «86be88c8437850fbf008f92fa0481423-76dc611d-0b1f-843f»};

        //    CheckAPIKey(options, function (event) {

        //        var data = JSON.parse(event.data);

            })

        });

    }

function connectTumSocket1(apiKey, callback) {

    socket = new WebSocket(«ws://localhost:6126/tumarcsp/»);

    socket.onopen = function(){

        isConnect = true;

        var options = {

            «apiKey»:apiKey

        };

    //    SetAPIKey(options, callback);

    }

    socket.onclose = function(){

        isConnect = false;

    }

    socket.onerror = function(event){

    }

}

Выходит ошибка:

Ошибка выполнения Microsoft JScript: ‘WebSocket’ — определение отсутствует

Подскажите, плиз, что нужно сделать?

Asked
9 years, 5 months ago

Viewed
3k times

When I run my project on IE 9, I get the following error:

Microsoft JScript runtime error: ‘JSON’ is undefined

I have tried online suggestions but none of them worked for me. If i run my project using Chrome then everything works fine.

Can someone help me?

Jonathan Wood's user avatar

Jonathan Wood

64.9k70 gold badges264 silver badges454 bronze badges

asked Dec 31, 2013 at 1:14

5

I think your website is running in Quirk Mode in IE9, try to set the proper html doctype, you can also try Json3 script.

answered Dec 31, 2013 at 9:37

Anwar Javed's user avatar

Anwar JavedAnwar Javed

3153 silver badges11 bronze badges

5

  • Remove From My Forums
  • Question

  • All the HealthVault pages (i.e. those derived from HealthServicePage) of a website suddenly started to generate the following error:

    Error: Microsoft JScript runtime error: ‘JSON’ is undefined

    These pages used to work fine and I have not done anything to them. All other pages under the website work fine.

    Any tip on how to debug this will be greatly appreciated.


    hz

Answers

  • Hello ,

    Thanks for the update on this issue. As i suggested in my first communication to this thread, the issue is with the browser which you are using. Try to uninstall the unnecessary add-on’s of IE or if the issue still remains re-install(clean installation)
    the browser to resolve the further issue related to script errors.

    Hope this helps.

    Regards,

    Madan Kamuju

    • Marked as answer by

      Wednesday, January 5, 2011 5:46 PM

User2027516926 posted

Hi all,

i have created wcf and call it through jquery but JSON.stringify(data) giving error my code is follows

what is wrong in this code can any one please help out me

data = JSON.stringify(data) this line giving error

WCF

using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.ServiceModel.Activation;

using System.ServiceModel.Web;

using System.Text;

using Test.AzureCloud;

namespace Test.AjaxWCF

{

[ServiceContract(Namespace = «»)]

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

public class blobServices

{

[OperationContract]

public void DeleteBlob(string ContainerName, string FileName)

{

string storeConn = Component.Configuration.GetDBConfigurationSetting(typeof(string), Common.Constants.Configkeys.storageConn).ToString();

blob blobHelper = new blob(storeConn);

blobHelper.DeleteBlob(ContainerName, FileName);

return;

}

// Add more operations here and mark them with [OperationContract]

}

}

ASPX code

<script src=»/Scripts/jquery-1.5.1.min.js» type=»text/javascript»></script>

<script type=»text/javascript»>

function fileUploadRemoving(sender, args) {

var containerN = args.get_fileInfo().containerName;

var blobN = args.get_fileInfo().FileName;

var data = { ContainerName: containerN, FileName: blobN };

data = JSON.stringify(data)

$.ajax({

type: «POST»,

contentType: «application/json; charset=utf-8»,

url: «/AjaxWCF/blobServices.svc/DeleteBlob»,

data: data,

async: true,

dataType: «json»,

success: function () {

},

error: function (msg) {

//alert(msg.d);

}

});

}

</script>

<asp:Panel ID=»pnl_Form» runat=»server»>

<table width=»100%» style=»border-style: none;»>

<tr><td>

<telerik:RadAsyncUpload runat=»server» ID=»RadAsyncUploadLogo» MultipleFileSelection=»Disabled»

MaxFileInputsCount=»1″ HttpHandlerUrl=»~/AsyncFileupload/Handler.ashx» OnClientFileUploadRemoving=»fileUploadRemoving»>

<FileFilters>

<telerik:FileFilter Description=»Logo(jpeg;jpg;gif;png)» Extensions=»jpeg,jpg,gif,png» />

</FileFilters>

</telerik:RadAsyncUpload>

</td>

</tr>

</table>

</asp:Panel>

Выполняю код.

    //_ТекстСкрипта;

    Скрипт = СоздатьОбъект(«MSScriptControl.ScriptControl»);

    Скрипт.Language = «JScript»;

    Скрипт.AddCode(_ТекстСкрипта);    

    Скрипт.Run(«init»);

ТекстСкрипта равен

var socket;

var isConnect = false;

function errorConnectDefault(data) { alert(data);}

var errorConnectCallBack = errorConnectDefault;

    function init() {

        connectTumSocket1(«7kaIenL3KzdAEgPVeXqtgOPwJEPTm558GMesUET+60JKxNzwG0JcEl97Vs+jE/A8WAzDGr1xkYoPvbaHGYVRDw==», function (event) {

            var options = {«apiKey»: «86be88c8437850fbf008f92fa0481423-76dc611d-0b1f-843f»};

        //    CheckAPIKey(options, function (event) {

        //        var data = JSON.parse(event.data);

            })

        });

    }

function connectTumSocket1(apiKey, callback) {

    socket = new WebSocket(«ws://localhost:6126/tumarcsp/»);

    socket.onopen = function(){

        isConnect = true;

        var options = {

            «apiKey»:apiKey

        };

    //    SetAPIKey(options, callback);

    }

    socket.onclose = function(){

        isConnect = false;

    }

    socket.onerror = function(event){

    }

}

Выходит ошибка:

Ошибка выполнения Microsoft JScript: ‘WebSocket’ — определение отсутствует

Подскажите, плиз, что нужно сделать?

Понравилась статья? Поделить с друзьями:

Не пропустите эти материалы по теме:

  • Яндекс еда ошибка привязки карты
  • Ошибка выполнения microsoft javascript
  • Ошибка выполнения javascript невозможно загрузить оригинал страницы
  • Ошибка выполнения createprocess exe openvpn
  • Ошибка выполнения ajax запроса

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии