ajax

How to get JSON object in Servlet from JSP?

In JSP page I have written: var sel = document.getElementById("Wimax"); var ip = sel.options[sel.selectedIndex].value; var param; var url = 'ConfigurationServlet?ActionID=Configuration_Physical_Get'; httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); httpRequest.open("POST", url, true); httpRequest.onreadystatechange = handler(){ if ...

jQuery - Ajax post result in html displaying in wrong position

I have a site with user posted threads that get voted on (up or down), and a vote count is displayed next to each thread. The voting up and down process is being done through jQuery/Ajax, and using something like this: $.ajax({ url: 'vote.php', success: function(data) { $('.result').html(data); } }); the html of the vote c...

Is it possible to send json object from jsp page to servlet?

I have some data in jsp page entered by user. i want to send this data to servlet. i dont want to submit the form. I am using json object and adding the data into it using : var param; var url = 'ConfigurationServlet?ActionID=Configuration_Physical_Get'; httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); httpRequest.open("POST", u...

Issues in Ajax based applications

I'm very interested in developing Ajax based applications. This is, loading almost all of the content of the application via XMLHttpRequest, instead of only some combos and widgets. But if I try to do this form scratch, soon I find some problems without an easy solution. I wonder if there is some framework (both client and server side) t...

How to get session variables from php server with Ajax function? (PHP HTML JS Ajax)

so in my php I have something like this $_SESSION['opened'] = true; But It will not be set to true until user will perform some actions with some other html\php pages So I need on some Ajax function to be able get this session variable. And some PHP sample of function to get variable in form ready for Ajax to get it. so I need someth...

Does jQuery ajaxSetup({cache: true}) generally work?

jQuery 1.4.2 omits the timestamp GET parameter (to defeat browser cacheing) if I assert the ajax cache setting in the local context: $.ajax({ url: searcher, data: keys, cache: true, type: 'GET', dataType: 'json', success: function(data) { // something }); But it includes timestamp if I move the set...

Adding a loading gif to simple script

Hello everyone, Im really really new to Javascript but Ive got this script that loads the contents of a url and everything works fine. I call the plannerSpin function with an onClick method on a button but how would I go about displaying an animated gif whilst all this is going on? var xmlHttp function plannerSpin(str) { xmlHttp = G...

Jquery Ajax : Dynamic Function

Hi there I am trying to write a function which allows me to perform an ajax call dynamically, but am unsure how to make the key which is passed to the ajax call dynamic... At the moment, my code is like this $('#ajaxButton').click(function(){ var form = $(this).parent().find(':input'); var formVal = form.val(); var object...

get XML from iframe cross domain with jquery

I need a little if help to solve this question. I need to get and XML from another server. My server can't make a request because of firewall. With javascript(jquery), What's the solution to make and ajax call cross-domain? I can make the request on client side but, How to get and xml node? Usign a proxy script does not work for me... A...

jQuery AJAX call not working in Webkit

I've run into a strange issue with Webkit based browsers (both Safari and Chrome - I'm testing on a Mac) and I am not sure what is causing it. Here's a small script I've created that replicates the issue: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt...

jQuery and AJAX

Can anyone help with a jQuery snippet that would use Ajax to pull an XML file in on page load? Have really clunky way of doing it without jQuery here: <script type="text/javascript"> function loadXMLDoc() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else ...

Problem with Google AJAX Search API RESTful interface

When I send the following query http://ajax.googleapis.com/ajax/services/search/local?v=1.0&amp;q=coffee%20New%20York%20NY using c# WebClient.DownloadString function or ordinary web browser I get JSON data which is different from data for the same query using JavaScript and Google AJAX Search API. From REST service I get the followin...

Rails - how to serialize a tree not in a form

I started with the standard scriptaculous drag and drop tree, and that all works fine. Then started implementing this: http://www.artweb-design.de/2008/5/30/scriptaculous-sortabletree which gives a good drag and drop tree Where I am stuck is how to get serialize the tree (unordered list)? It's not in a form, and I can't find a way to s...

Ajax Questions to Form and Request

Hello to everybody. Now i have create my first ASP.NET MVC Projekt. I think this is a good structure and a nice concept. But now i want to add some dynamic things. My Problem is that i wanted to display 3 select boxes where 1 should be updated. Here is my code below. <code> <table width="100%"> <!--Headers--> <tr> <td><h4>Roles</h4><...

Generated HTML is not rendered after jquery AJAX call

Hi, I am using jquery tabs with a Java portlet application. When the tab content is being rendered by an AJAX call, the the JSP generates all input elements that is required into a Java String variable. This Java String variable is used a as Java scriptlet within the form tags. The final generated HTML comes up within jquery tabs. H...

Spider/Crawler for testing an AJAX web app that requires a session cookie?

We have a web app that is heavy on AJAX and it is very customizable so we need something that will click on every link in it to make sure that none of the forms/pages break. I know that there are lots of spiders/crawlers out there but we haven't been able to find one thats easy to implement and works with AJAX and allows you to have a se...

How to navigate around a '[' in JSON.

I'm new to JSON and moving around in it in jQuery. I'm fine until I hit a '[', as in: "gd$when": [{ "startTime": "2006-11-15", "endTime": "2006-11-17", "gd$reminder": [{"minutes": "10"}] }], I tried to do a eventTime = event["gd$when"]["startTime"]; to get to the 'startTime' (Yes, event is the variable for ajax stu...

JQuery.ajax success function returns empty

I have a very basic AJAX function in JQuery: $.ajax({ url: "http://www.google.com", dataType: "html", success: function(data) { alert(data); } }); But the data is always an empty string, no matter what url I go to... Why is that? I am running this locally at http://localhost:3000, and am using JQuery 1.4.2. ...

How can I speed up a 1800-line PHP include? It's slowing my pageload down to 10sec/view

I designed my code to put all important functions in a single PHP file that's now 1800 lines long. I call it in other PHP files--AJAX processors, for example--with a simple "require_once("codeBank.php")". I'm discovering that it takes about 10 seconds to load up all those functions, even though I have nothing more than a few global arr...

Is there any way to make this JavaScript tab completion script more efficient?

This code is to be integrated into an AJAX Chat system to enable a tab auto-completion of user names: var usernames = new Array(); usernames[0] = "Saladin"; usernames[1] = "Jyllaby"; usernames[2] = "CadaverKindler"; usernames[3] = "qbsuperstar03"; var text = "Text and something else q"; // Start of the script to be imported var search...