"JSON not defined" error

Asked

Viewed 713 times

0

Hello, I have a facebook API that picks up the posts from my page and shows in a Patcher that I did, it was working properly, but a few weeks ago this error started to appear and the posts no longer appear.

Error:erro JSON

Here’s the code I’m using.

    <html>
    <body bgcolor="#E8D084">
    <head>
    <title></title>
    </head>
    <link rel="stylesheet" href="style.css" type="text/css">
    <body style="overflow-y: hidden">
    </head>
    <body SCROLL="no">
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.4";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    <div class="fb-page" data-href="https://www.facebook.com/NextRO685441651600367/timeline/" data-width="413" data-height="290" data-small-header="true" data-adapt-container-width="false" data-hide-cover="false" data-show-facepile="false" data-show-posts="true"></div>
    </body>
    </body>
    </body>
    </html>

I hope someone can help me.

  • 1

    Try to type="text/javascript" in <script>. Another thing, it’s not relevant to the question that, but why so much body and head in a single document ? Gives a revised in this structure, which may not solve your problem, but gives a lot of an improved in what has.

  • I may be talking nonsense, try inserting in the head an import of the jquery type <script src=js/jquery.js></script>

  • I had the same problem. For me it was solved by adding a reference from the JSON library. https://github.com/douglascrockford/JSON-js More information: http://www.devcurry.com/2010/12/resolve-json-is-undefined-error-in.html

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.