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 6191311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:44:29+00:00 2026-05-24T02:44:29+00:00

I have a page where i am using the wikipedia api . But since

  • 0

I have a page where i am using the wikipedia api. But since i cannot use JSON for cross domain restrictions i use JSONP. My code looks like this

<body>
<script type="text/javascript">
function res(data){
  alert(data);
};
</script>
<script type="text/javascript" src="http://en.wikipedia.org/w/api.php?action=opensearch&search=api&callback=res&limit=10&namespace=0&format=jsonfm">
</script>
</body>

here i am providing the callback function named res in the url. As i saw in firebug the response came as

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MediaWiki API Result</title>
</head>
<body>
<br />
<small>
You are looking at the HTML representation of the JSON format.<br />
HTML is good for debugging, but probably is not suitable for your application.<br />
See <a href='http://www.mediawiki.org/wiki/API'>complete documentation</a>, or
<a href='/w/api.php'>API help</a> for more information.
</small>
<pre>
res([
&quot;api&quot;,
[
&quot;API&quot;,
&quot;Apiales&quot;,
&quot;Apiaceae&quot;,
&quot;Apia&quot;,
&quot;Apicomplexa&quot;,
&quot;Apicomplexa lifecycle stages&quot;,
&quot;Apidae&quot;,
&quot;APIA Leichhardt Tigers&quot;,
&quot;Apical membrane&quot;,
&quot;Apical consonant&quot;
]
])
</pre>
</body>
</html> 

This means that the server is sending the response enclosed in the callback function res but this function is not executed by the browser(the alert is not being called).I am using firefox 5. Whats wrong with this?

  • 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-05-24T02:44:29+00:00Added an answer on May 24, 2026 at 2:44 am

    It says it right there in the response:

    You are looking at the HTML representation of the JSON format.
    HTML is good for debugging, but probably is not suitable for your
    application.

    try

    <script type="text/javascript" src="http://en.wikipedia.org/w/api.php?action=opensearch&search=api&callback=res&limit=10&namespace=0&format=json">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PeerTracker http://en.wikipedia.org/wiki/PeerTracker to track torrent hashes. I have a simple HTML page
I have saved an html page using the following line of code : NSURL
I have simple WebView code like this: WebView wv = (WebView) findViewById(R.id.webview1); wv.loadUrl(http://en.wikipedia.org/wiki/Book); But
I am looking to retrieve the XML of a Wikipedia page using their api.
I have trouble understanding wikipedia API. I have isolated a link, by processing json
I have a page using something along the lines of <meta http-equiv=refresh content=0;url=http://example.com/ />
I have page (Default1.aspx) in which I am redirecting to another page (Default2.aspx) using
I have an ASP.NET page using the AJAX control toolkit for some controls. A
I have one page website only using HTML, CSS and JavaScript. I want to
I have a page that is using jQuery tabs. Within one of my tabs

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.