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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:31:27+00:00 2026-06-04T23:31:27+00:00

The alert with success is not fired when i run this. I checked with

  • 0

The alert with “success” is not fired when i run this. I checked with firebug, and it tells me that ret is undefined. What does that mean?

function checkUni() {

var URL = "http://localhost:8080/GradSchoolApp/test.jsp";

var ret = $.getJSON(URL, function(data, textStatus) {
    alert("success");
});
}

EDIT:

this is the test.jsp btw

<%@ page language="java" contentType="application/json; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.util.*, net.sf.json.JSONObject"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
response.setContentType("application/json");
JSONObject jo = new JSONObject();
jo.put("location", "1");
jo.put("name", "someUni");
out.println(jo);
out.flush();

%>
</body>
</html>
  • 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-06-04T23:31:29+00:00Added an answer on June 4, 2026 at 11:31 pm

    The AJAX call did not work. A few points to check, is the URL correct? Did you check the application server log to see if the call has ever reached. Can you check firebug for the HTTP code if the AJAX call is successful?

    EDIT:

    (Changed from text/json to application/json) Thanks Bergi

    JSP:

    <%@ page contentType="application/json" %>
    

    Java Servlet:

    response.setContentType("application/json");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone tell me if this: $.ajax({ url: 'test.html', success: function(data) { alert(Data Loaded:
I do not know what is wrong with this code. alert shows that data
$.ajax(changeposition.aspx?id=1&pos=1, { success: function(){ alert('success!'); } }); In chrome that code gives an error
This is what I'm doing: $.ajax({ url:localhost:8888/check_app, success:function(data) { alert(success!); callback(data); }, error:function(data){ alert(JSON.stringify(data));
Here's my jQuery: var docname = $('#doc').val(); function parseXml(xml) { $(xml).find(rsp).each(function() { alert(success); });
I am using Bootstrap alerts and this is my success alert message: <div class=alert
Here's my code: $('#fb_login_form').bind('ajax:loading', function() {alert(loading!);}); .bind('ajax:success', function(data, status, xhr) {alert(success!);}) .bind('ajax:failure', function(xhr, status,
I have some very simple sample code like this: $.ajax({ url: 'demo2.htm', success: function(loadeddata){
After testing AjaxFileUpload Plugin I discovered that it does not let me retrieve $_POST
I have this simeple jQuery code: $('#category_name').change(function() { alert('Handler for .change() called.'); var category

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.