Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7712873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:44:04+00:00 2026-06-01T01:44:04+00:00

I have an external resource similar to https://www.googleapis.com/freebase/v1/text/en/bob_dylan which returns a JSON. I want

  • 0

I have an external resource similar to https://www.googleapis.com/freebase/v1/text/en/bob_dylan which returns a JSON. I want to display the value of result key in a div in html (lets say the name of the div is “summary”). Also the value of result key should be displayed in plain text.
The URL returns the json:

{ “result”: “Bob Dylan, born Robert Allen Zimmerman, is an American
singer-songwriter, author, poet, and painter, who has been a major
figure in popular music for five decades. Much of Dylan’s most
celebrated work dates from the 1960s, when he became an …….” }

The JSON has just the result key, no other keys
Basically I do not want to use anything other than plain HTML and JavaScript. I am a relative beginner to JavaScript and therefore I ask for commented code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:44:05+00:00Added an answer on June 1, 2026 at 1:44 am

    You can do this with JSONP like this:

    function insertReply(content) {
        document.getElementById('output').innerHTML = content;
    }
    
    // create script element
    var script = document.createElement('script');
    // assing src with callback name
    script.src = 'http://url.to.json?callback=insertReply';
    // insert script to document and load content
    document.body.appendChild(script);
    

    But source must be aware that you want it to call function passed as callback parameter to it.

    With google API it would look like this:

    function insertReply(content) {
        document.getElementById('output').innerHTML = content;
    }
    
    // create script element
    var script = document.createElement('script');
    // assing src with callback name
    script.src = 'https://www.googleapis.com/freebase/v1/text/en/bob_dylan?callback=insertReply';
    // insert script to document and load content
    document.body.appendChild(script);
    

    Check how data looks like when you pass callback to google api:
    https://www.googleapis.com/freebase/v1/text/en/bob_dylan?callback=insertReply

    Here is quite good explanation of JSONP: http://en.wikipedia.org/wiki/JSONP

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button control which its template is stilyzed in an external resource
I have an external file in php, outputed as json format I want the
I have an icon in my resource file , which I want to reference.
I have a connection to an external resource that I need to make for
I have a problem with loading icons from external resource files in main application.
I have an external style resource in a resource dictionary I'm referencing with x:Key.
I have a web application using Kerberos to access an external resource useing ASP.NET
I have a system which needs to send requests to an external system, whenever
I have the following scenario: URL u1 = new URL(http://www.yahoo.com/); URL u2 = new
I have external html5 canvas that you can paint on some lines using your

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.