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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:24:58+00:00 2026-05-30T01:24:58+00:00

The response of my request is a java script code. When I put the

  • 0

The response of my request is a java script code. When I put the url in browser, I can see the whole generated java script code on the page. Format of url passed to $.ajax is as below:

http://localhost:8080/vi-api/viapi?action=tag&projectId=45&tagId=345

When I put the above URL I can see the request is successful. Now, I am using below Ajax request for this url using jQuery.

   var finalUrl = "http://localhost:8080/vi-api/viapi?action=tag&projectId=45&tagId=345";
   var req = $.ajax({
             type:"GET",
             url:finalUrl,
             type:"script",
             data:"",
             success: function(html){
                alert('Requese sucessful.');
              },
            complete:function(jqXHR, textStatus) {
                alert("request complete "+textStatus);
             },
            error: function(xhr, textStatus, errorThrown){
                alert('request failed->'+textStatus);
            }             
           });  

Question 1:This gives the alert “request failed error’. Why this is so ?

Question 2:Is there any way to return success/failure code in above process?

  • 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-30T01:25:00+00:00Added an answer on May 30, 2026 at 1:25 am

    In:

    $.ajax({
         type:"GET",
         url:finalUrl,
         type:"script",
         (...)
    

    You have two times the ‘type’ key in your object. So I think only the second one is taken (‘script’). Obviously ‘script’ is not a valid HTTP method (as HEAD,GET,PUT,POST, etc). The keyword your were looking at for ‘script’ is maybe dataType which may be one of xml, json, jsonp, text, script, or html.

    Do not forget to look at jsonp, it’s usually a nice way to return a script content and to call it.

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

Sidebar

Related Questions

Does anyone know of a utility that can check whether a HTTP request/response is
How do I capture HTTP response when the request is made by web browser?
I have an HTML page with a JavaScript code that sends AJAX request. The
I need to find a way to get at the request/response streams inside of
I am wondering how the HttpContext is maintained given that the request-response nature of
`I am working with an API that sends back an XML response upon request.
According to RFC2616 if I return 401 in response to a request to my
The request I sent is accept gzip but the response is not compressed, instead,
A urllib2 request receives binary response as below: 00 00 00 01 00 04
I have response stream from a ftp web request that returns binary file. I

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.