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 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
Advertisements
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
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
Struts 1.2 and ajax example
Struts 1.2 and ajax example  Struts 1.2 and ajax example with data from database
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
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
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
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
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
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
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>
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> <
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
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><
Selecting value from autocomplete textbox using jquery in jsp
Selecting value from autocomplete textbox using jquery in jsp   hello Sir, I completed ur tutorial on autocompletion textbox from database using Jquery in jsp .It worked Fine .Thank you For Ur valuable Guidance .But it does
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
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
Ajax Example
Ajax Example
Ajax Example
Struts 2.2.1 Ajax Tags And Example
Struts 2.2.1 Ajax Tags And Example a autocompleter bind datetimepicker div head submit tabbedpanel textarea tree treenode
Example of anchor(Ajax) in struts2.2.1
-style: italic; } Example of anchor(Ajax) in struts2.2.1 In this example, you will see the use of Ajax(anchor) tag.  Here, we are changing value of div tag with the help of Ajax anchor tag.   1- index.jsp <
ajax
ajax  please describe the ajax
Ajax
Ajax  How to learn AJAX
Ajax
Ajax  Hi, What is Ajax? What is the use of Ajax? Thanks   Hi, Ajax is set of technologies used to develop dynamic web applications. In Ajax following technologies is used: a) JavaScript b) XML c) HTTP d) CSS Learn
Ajax
Ajax  how to impliment ajax in registration table using jsp-servlet
ajax
;This very simple Ajax Example retrieves the current date and time from server...ajax  How can we fetch data in ajax through servlet?   "mainpage.jsp" <html> <head> <title>Ajax Example</title>

Ads