Tag: ajax

JQuery error property for error handler

I’m just playing around for the first time with jQuery’s ajax functionality. I wanted to add a function that could handle any errors. So, in one of my client javascript blocks, I added the following line: <script type=”text/javascript”> …. $.ajax({ error: function () { alert(‘boo’); } }) …. </script> I expected that this would bind […]

Minimum time between subsequent AJAX calls

In AJAX applications that need to poll the server in regular intervals (like a chat applications), what is the recommended minimum time between two calls, so that the update is done as quickly as possible? What times are considered as hogs for the server and the client?

Using the Google maps API with JavaScript or PHP?

i’ve read that you can use either javascript or php with google maps api. so what are the pros and cons for each of them? and if i got the geocodes stored in a database. should i get them with ajax and process them with javascript or should i use php? it says in the […]

jQuery, passing success data from AJAX to another function?

I’m trying to get the success data from a jquery Ajax call so I can use it elsewhere but for some reason its only accessible within the actual success call, so immeditaly below works but the other doesnt’.. any advice is appreciated success: function(data) { alert (data) } this doesn’t work when I try to […]

How to send web browser a loading page, then some time later a results page

I’ve wasted at least a half day of my company’s time searching the Internet for an answer and I’m getting wrapped around the axle here. I can’t figure out the difference between all the different technology choices (long polling, ajax streaming, comet, XMPP, etc.) and I can’t get a simple hello world example working on […]

Making a 'mobile/cell' version of a PHP/Javascript website?

I’m about to potentially start work on a website, but the client has a requirement that the website should also be accessible from mobiles/cell phones. He hasn’t mentioned which mobiles he wants to support in particular but I assume it would be smart phones like iphone, blackberry, android, etc. My question is, how much work […]

Unable to get google analytics to work on my page which uses AJAX to load its pages

So after a huge headache, I got my site to load its pages all via ajax. The reason being the client wanted it to flow exactly like their old flash site.. duh. Anyway, everything was dandy, but then I added the google analytics trackers, and it wont load anymore! So heres how I am doing […]

Best Method: Parsing CSV file and Passing back to front end using AJAX

I have a CSV file that is uplaoded to my server where a PHP script will parse and return output to JavaScript via AJAX. The CSV file is made up of two rows. First row contains the column names and the second row contains the data. I am trying to write a script that will […]

jquery, ajax, load post result to div

I have a form that I need to post and show the result in a div. I’m not having any problems making the ajax call but I can’t seem to figure out how to load the result to a div. I have tried: $.ajax({ type: ‘POST’, data: $(‘#someForm’).serialize(), url: ‘http://somedomain.com/my/url’, success: function(data) { $(‘#someDiv’).load(data); } […]

How can I make 'AJAX templates' in Pylons?

I’ve been getting into Pylons lately and was wondering how I could go about easily integrating AJAX functionality into my websites. Basically, lets say I had a login form that usually gets accessed via site.com/user/login. Now, generally, this will be handled via something like: class UserController(BaseController): def login(self): render(‘/login.html’) login.html would be a template that […]