Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Ajax



  Commonly used AJAX frameworks

Have you ever wondered to design your website like desktop applications? Fortunately, with AJAX we can achieve this. By using AJAX, we no need to refresh the whole page when we just want to update a portion of a website such as the weather information or news panel. This makes our web apps look like desktop applications and bring good user experience to our visitors. You can create an XMLHttpRequest object every time when you want to initialize an AJAX call, unfortunately you may need repeat eve...

   AJAX,framework,jQuery,Dojo,YUI     2012-06-27 04:40:05

  Let browser prompt for storing password when doing AJAX login

In Web 2.0 era, more and more web applications are using AJAX to replace the traditional HTML form element to perform user login. This usually provides a better user experience than form submission. But it also brings a side effect to the end users. That is the browser will not prompt the user whether s/he wants to save the password so that s/he no needs to enter the username/password again when visiting the same site next time. Below is the code snippet which does the AJAX login.  <scri...

   AJAX,Browser,Login,Password     2015-06-04 10:02:46

  PHP to get long running process progress dynamically

Frequently in web applications, we may have a request to the back end system which may trigger a long running process such as searching huge amount of data or a long running database process. Then the front end webpage may hang and wait for the process to be finished. During this process, if we can provide the user some information about the progress of the back end process, it may improve user experience. Unfortunately, in web applications, this seems not an easy task because web scripting lang...

   AJAX,PHP,progress,long process,demo     2012-06-04 07:29:37

  An easy way to log client side information to server

JavaScript debug is a very troublesome thing in web application development. Because many web browsers will not notify you if there is any error in the JavaScript codes you write. They just silently fail and block the following codes execution. In order to debug JavaScript codes, we need a good log mechanism which will help us log the error information,, we often need to log errors in JavaScript codes to server for debug purpose in a production web application, What should we do? The first ...

   JavaScript log, Ajax,Image,Debug     2012-12-30 09:16:50

  How to let Google index AJAX contents?

There are lots of websites containing only one page now with the popularity of AJAX. The website will load different contents according to different inputs from users. This approach provides good user experience and it also helps save bandwidth, the drawback is that AJAX contents are not easy to be indexed by search engines. For example, if you have a website: http://example.com Users can see different contents with the appended # structure in the URL: http://example.com#1 http://example.com#2 h...

   AJAX,Search engine,Google,History     2013-07-16 00:47:14

  How to monitor user behavior in webpage

Sometimes there is a need for website owners to monitor user behavior on the site so that they can know what pages are mostly visited and which parts are more popular so that they can provide better service to their users. These behavior usually contain user clicks, user mouse over events etc. These data can be sent back to server when triggered with some meta data. In this post, we will cover a few ways to monitor user behavior on a web portal and send data back to backend sever. 1. Synchronous...

   HTML,BEACON API,PING,USER BEHAVIOR     2019-06-29 06:06:59

  An experience on fixing HTTP 406 Not Acceptable error

This post is about an experience of mine on fixing a HTTP 406 Not Acceptable error seen on one of my page. Just got back from a business trip and opened my computer as usual to start to monitor my website statistics. But when I opened the page on showing real time page views, it shows nothing but zero. So I pressed F12 to bring up the developer tool to check on what's going on. The logic of loading the real time page view is backed by AJAX call. In the developer tool console, I see that the rAJA...

   PHP,AJAX,HTML,HTTP 406,CONTENT-TYPE     2019-03-30 04:09:10

  About JavaScript source map

Last week jQuery 1.9 was released. This is the last release before jQuery 2.0. It adds many new functions, one of them is the source map. By accessing http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js , you can scroll to the last line and you will see below line :  //@ sourceMappingURL=jquery.min.map This is source map, it is a separate file and it is put at the same directory as the source file. You can click here and see what it looks like. It's an very useful functio...

   Source map, JavaScript, jQuery     2013-02-01 07:06:44

  passing parameters to XMLHttpRequest’s onreadystatechange function

I’ve been smashing my head against this all day – but I finally got something working consistently and reliable, so I better damn well document it. This is as good a place as any, and hopefully it will be useful to others.I needed to make an Ajax call, so I turned to my good friend XMLHttpRequest. One wrinkle was that I needed to pass in a parameter to it… so I tried:var test = "bar"; req = new XMLHttpRequest(); req.open("GET", myURL, true); req.foo = test; req.onreadystatech...

   JavaScript,AJAX,XMLHttpRequest,parameter,onreadystatechange     2011-10-09 01:32:09

  JSON in JavaScript

When sending an AJAX request to the server, the response can have two formats : XMLHttpRequest.responseXML to access data with XML format and XMLHttpRequest.responseText to access data with string format. XML is the standard data transfer format, but one weakness is it's troublesome to parse and retrieve the data. JSON(JavaScript Object Notation) is a light weight data interchange format, we call it the JavaScript object representation. The advantage of using JSON as the data format is itself is...

   JSON,JavaScript     2013-05-04 23:25:57