0

I am using json for specific operations but when i am try to use in i.e 7 it is giving me the error of

'JSON' is undefined

I have searched for that and used "json.js" in my HTML page directly that seems to be

<head>    
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link href="style/style.css" rel="stylesheet" />
    <link href="style/menu.css" rel="stylesheet" />
    <link href="style/bootstrape/bootstrap.min.css" rel="stylesheet" />
    <link href="style/bootstrape/bootstrap-theme.min.css" rel="stylesheet" />

    <script src="jquery/json.js"></script>
    <script type="text/javascript" src="jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="jquery/bootstrap.min.js"></script>
</head>

But it's giving me the error of

Object doesn't support property or method 'exec'

and also has stopped working in firefox and chrome. Sometimes my bootstrape controls are also not working with this.

I am also using $(window).scroll(function () { //some stuff }); for scrollling and it's also giving me the error in that.

Any help is appreciated.

1
  • Please do not use "bootstrap" tag, use "twitter-bootstrap" since it means something else Commented Oct 14, 2014 at 12:31

1 Answer 1

1

Finally I have resolved it by ample of try, replaced the json.js to json2.js

JS

https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json2.js

HTML

<head>   
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link href="style/style.css" rel="stylesheet" />
    <link href="style/menu.css" rel="stylesheet" />
    <link href="style/bootstrape/bootstrap.min.css" rel="stylesheet" />
    <link href="style/bootstrape/bootstrap-theme.min.css" rel="stylesheet" />

    <script type="text/javascript" src="jquery/jquery-1.11.1.min.js"></script>    
    <script type="text/javascript" src="jquery/bootstrap.min.js"></script>
    <script type="text/javascript" src="jquery/json.js"></script>
</head>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.