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 have a page using <ul> lists for navigation (Javascript changes the styling to
I have a ASP.Net page using ADO to query MS access database and as
I have a page that is using a non-standard font and arial as a
I have a page that is currently using the datetime microformat to display a
I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have a web page that is being displaying in a winform app using
I have created a user login page and am using Forms Authentication. Users are
We have an HTML page which displays a bunch of pretty bars using divs
I am working on a web page that is using jQuery. I have an
I'm working on an ASP.NET page, using VB.NET and I have this hierarchy: Page

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.