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

  • Home
  • SEARCH
  • 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 6719685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:07:19+00:00 2026-05-26T09:07:19+00:00

I have following ajax call in my JavaScript code url = ‘http://news.ycombinator.com/?callback=?’; $.ajax({url:url ,async:!1,dataType:’script’,

  • 0

I have following ajax call in my JavaScript code

url = 'http://news.ycombinator.com/?callback=?';
$.ajax({url:url ,async:!1,dataType:'script', complete:function(result)
                                   {alert(JSON.stringify(result));} 
      });

Following is printed out in alert.

{'readyState':4, status:200, statusText:'success'} 

It doesn’t have responseText.But still, in the chrome console I can see all of the return HTML data of ycombinator page.How can I access this text?

On the other hand if I change the url variable to a url which returns a valid json object like following,

urll = 'http://gdata.youtube.com/feeds/api/videos?q=basshunter&format=5&max-results=5&v=2&alt=jsonc';
$.ajax({url:urll ,async:!1, complete:function(result)
                                   {alert(JSON.stringify(result));} 
      });

this returns all of the responseText as expected.

One thing to note is if I don’t point the url to a valid JSON returning url as in first case, I have to provide option dataType:’script'(or JSON).Otherwise it will throw a cross-domain request error.In second case it didn’t throw any cross-domain error even if I didn’t specify dataType.

  • 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-26T09:07:19+00:00Added an answer on May 26, 2026 at 9:07 am

    Replace your complete callback with success. Success callback executed when ajax request completed successfully.

    Also in your dataType use “json” instead of “script”
    if you use “script” in dataType it will return like "{\"key\":\"value\"}".

    if you use “json” in dataType it will return like {"key":"value"}.

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

Sidebar

Related Questions

I have the following Javascript libraries loaded for my page. <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js></script> <script
I have the following javascript snippet: $.ajax({ url: self.LoadCirculationListUrl, cache: false, async: false, dataType:
Let's say I have the following jQuery AJAX call: $.ajax({ type: POST, url: MyUrl,
I have the following javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: {
I have the following ajax call: $(#welcome a.close).click(function(e) { $.ajax({ type: GET, url: /visitors/hide_welcome,
The problem is the following. We have lots of ajax call via $.ajax function.
I have the following piece of code: // setup the AJAX request var pageRequest
i have the following javascript to post a form through ajax without refreshing the
I have the following code that works on Firefox and Chrome $("#adicionarItem").click(function(){ $.ajax({ type:
I have the following HTML structure: $('#subgroup a').nextUntil('h3').wrapAll('<div></div>'); <script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js></script> <div id=subgroup> <h3>Group name

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.