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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:23:04+00:00 2026-05-23T10:23:04+00:00

$.ajax ‘/’, type: ‘GET’ dataType: ‘html’ error: (jqXHR, textStatus, errorThrown) -> $(‘body’).append AJAX Error:

  • 0
$.ajax '/',
    type: 'GET'
    dataType: 'html' error: (jqXHR, textStatus, errorThrown) ->
        $('body').append "AJAX Error: #{textStatus}"
    success: (data, textStatus, jqXHR) ->
        $('body').append "Successful AJAX call: #{data}"

there is something wrong with the above code,I can’t compile it into js

  • 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-23T10:23:05+00:00Added an answer on May 23, 2026 at 10:23 am

    The compiler gives the error

    Parse error on line 3: Unexpected 'IDENTIFIER'
    

    referring to the line

    dataType: 'html' error: (jqXHR, textStatus, errorThrown) ->
    

    The problem is simply that there’s no comma (or line break) between 'html' and error. Here’s the fixed code:

    $.ajax '/',
        type: 'GET'
        dataType: 'html'
        error: (jqXHR, textStatus, errorThrown) ->
            $('body').append "AJAX Error: #{textStatus}"
        success: (data, textStatus, jqXHR) ->
            $('body').append "Successful AJAX call: #{data}"
    

    I highly recommend using an editor with a built-in “Build” command, especially one that can work on selected text. It makes syntax errors a lot easier to pin down.

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

Sidebar

Related Questions

$.ajax({ type: GET, url: something.html, dataType: xml, success:function(data){} , }); The content while accessing
$.ajax({ type : GET, dataType : jsonp, url : '/', data : {} success:
$.ajax({ type: GET, url: awards.xml, dataType: xml, success: parseXml }); function parseXml(xml) { I
$.ajax({ type: 'GET', url: string.txt, cache: false, success: function(str){ alert(Data is: + str); }
$.ajax seems to be broken for me: $.ajax({url:'getGalleries.php', datatype:'jsonp', success: function(data){ $('#galleries').html(''); $.each(data,function(key,value) {
$.ajax({ type: POST, url: check.php, data: checkit= + $(#checkEmail).val(), success: function(response){ $(#userCheck).html(response.status); if(response.status ==
$.ajax({ type: POST, url: ajax.php, dataType: 'json', data: callback=bumpup_contact_us_entry&id= + id, success: function(data){ $.each(data,
$.ajax( { type: POST, url: Default.aspx/GetAge, data: {}, contentType: application/json; charset=uft-8, dataType: json, success:
$.ajax({ async:false, type: 'POST', url: itemURL, success: function(data,status,jqXHR) { responseObj = data; console.log('success function
$.ajax({ type: POST, url: contacts.php, data: dataString, cache: false, success: function(data, status, settings) {

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.