Big Data and Hadoop Training @$80 or Rs. 6,000 only - valid till Oct 17th Apply Now!

JQuery-JSP AJAX example not working

Ads
 

JQuery-JSP AJAX example not working

Hi, I while back ran you tutorial at http://www.roseindia.net/tutorial/jquery/jqSquareroot.html. I copied to code to my location and ran it locally. It worked fine.

When running my own development code (following your example (and by the way, thanks for helping me get started with AJAX)), I was able to get it working. Just recently, I have been working on some additional development code using AJAX and I was getting some strange results, where my success call back function was being passed a javascript object, not the data that I expect, which would have been a string.

I went back to the original example figuring I must be doing something wrong. I again copied your example and ran it on my PC. When I ran it, the results return from the example were:

Enter number: 3 "Calculate Square Root"

[object XMLDocument]

where "Enter number:" is the label, "3" is my entry, "Calculate Square Root" is the button and "[object XMLDocument]" are the results after clicking on the button.

The only change in the source code that was copied was that I changed the version of jquery to jquery-1.7.2.min.js.

My question:

Does your example work in your environment if you use a later version of jquery?

View Answers

September 26, 2014 at 3:54 PM

Duh!! Please ignore my question. It turns out I was trying to access the application through directory file access not through an HTTP server. It works fine for me.

Jim

Ads









Related Tutorials/Questions & Answers:
JQuery-JSP AJAX example not working
JQuery-JSP AJAX example not working  Hi, I while back ran you... started with AJAX)), I was able to get it working. Just recently, I have been working on some additional development code using AJAX and I was getting some
Ajax not working in jsp
Ajax not working in jsp  I'm using Netbean, Ajax validation in the following code is not working the code succesfully run for first UID validation...; frmMain.elements[i].valid; } } return blnValid; } //if Ajax
Advertisements
Ajax example
Ajax example   Hi, Where can I find Ajax example program? Thanks   Hi, Get it at: Ajax Tutorials First Ajax Example Ajax Login Example Thanks
window.open() not working - Ajax
is that the pop up window is not at all working.. Once I click the button, the page
ajax example
in jsp page?   Hi, Please read Ajax First Example - Print Date... ajax get example jQuery ajax get example  Hi, How I can use jQuery...Ajax Example Here is the list of few Ajax examples at RoseIndia.net. Ajax
JDBCTemplate BatchUpdate() example not working
JDBCTemplate BatchUpdate() example not working  Hi, I tried the JDBCTemplate BatchUpdate example, with IBM DB2 database. I updated the dataSource bean values accordingly. When I try, the program runs fine, however the database
Hibernate Basic Example not working
Hibernate Basic Example not working  I have implemented basic hibernate example from your site . In console i got output but database is not affected. hbm.xml <id name="id" type="long" column="id"> <generator
jquery - JSP-Servlet
jquery with jsp. Please send the code for me immediately. Regards...://www.roseindia.net/ajax/jquery/ Hope that it will be helpful for you. Thanks...jquery  Hi, I need validation script for jquery. I have username
Working Example for Spring AOP - Spring
Working Example for Spring AOP  Hi All, I need a complete working Java example /Code/Logic for Spring -Aspect Oriented Programming. Code provided will be highly appreciated. -- Deepak Lal
Struts 1.2 and ajax example
Struts 1.2 and ajax example  Struts 1.2 and ajax example with data from database
Ajax post example
Ajax post example  Hi, I am looking for ajax post example. Thanks   Hi, You can use jQuery to jQuery Post Data. Thanks
ajax login example
ajax login example  hi deepak, i am trying to execute ajax login example in eclipse but it show the form but when I enter admin admin it shows invalid credentials how to resolve
How to write first example in Ajax?
How to write first example in Ajax?  Hi, I am beginner in Ajax and want learn it. How can I write first example in Ajax? Thanks   Hi, Please check the tutorial First Ajax Example. Thank
jQuery ajax get example
jQuery ajax get example  Hi, How I can use jQuery for get request? Give me code for jQuery ajax get request. Thanks
DOJO HelloWorld Example - Ajax
DOJO HelloWorld Example  Hi I am total in using DOJO for AJAX purpose From the HellowWorld example Hello World! The Button has already the onClick the helloPressed() function directly. SO what and when exactly does
Ajax form validation Example
to validate form in Ajax using jQuery framework. Thanks...Ajax form validation Example  Hi, I want to validate my ajax form. Please give me good code for Ajax form validation. Thanks   Hi, Read
Ajax example doesn;t work - Ajax
Ajax example doesn;t work  Hello every one, I'm new to Ajax and was playing around with code in this link: http://www.roseindia.net/answers/viewanswers/1219.html It works but it doesn't printout the result to the user
How to use Jquery in jsp page
How to use Jquery in jsp page  Hello Sir, I am developing a web application in which i have to show database table values into Gridview in my jsp page. I have heard that jquery will be usefull for this work
AJAX Example
AJAX Example       In the following example we will see how to display server IP address dynamically with the help of AJAX, HTML, & PHP. SimpleAjax.html <html> <body>
First Ajax Example
Ajax First Example - Print Date and Time   .... This is the first example in Ajax that will give you quick start in the Ajax...;This very simple Ajax Example retrieves the current date and time
query related to roseindia example - Ajax
query related to roseindia example  http://www.roseindia.net/ajax/File-Upload.shtml In FileUploadServlet.java where is "fileupload package" I am getting error on "import org.apache.commons.fileupload.disk.DiskFileItemFactory
Struts2 ajax validation example.
Struts2 ajax validation example. In this example, you will see how to validate login through Ajax in struts2.  1-index.jsp <html> <head> <title>Ajax_Validation_Example</title> </head> <
Display current time using jQuery & JSP
. In this example I am explaining about the use of jQuery in JSP page for getting...Display current time using jQuery & JSP In this Tutorial we will develop a Html page which displays current date and time using jQuery and JSP
Java Example program to get the current working directory
Java Example program to get the current working directory       This example java program illustrates to get the current working directory (CWD). With the File class
Struts2.2.1 Ajax div tag example.
Struts2.2.1 Ajax div tag example. In this section, we will introduce you to about the Ajax div tag. The div tag when used with Ajax refreshes the content... <html> <head><title>Ajax_Div_Tag_Example</title><
select value from autocomplete textbox using jquery in jsp from database.
select value from autocomplete textbox using jquery in jsp from database.  Hii Sir, Lots of thnx to ur reply .I went through both... of selecting value from autocomplete textbox using jquery in jsp from mysql database
select value from autocomplete textbox using jquery in jsp from database.
select value from autocomplete textbox using jquery in jsp from database.  Sir, Lots of thnx to ur reply .I went through both the tutorials... autocomplete textbox using jquery in jsp from mysql database. Kindly send me
Ajax
Ajax  send the example to fetch the data from the server by using ajax in java. for ex:-if there are states which is used to display in frontend we use ajax. send it to me
Ajax Example
Ajax Example
Ajax Example

Ads