Simon Willison’s Weblog

Entries tagged ajax

Filters: Type: entry × ajax ×


Is it probable that one of the major forum software packages will support Ajax soon?

Those codebases are all terrifyingly ancient. I suggest taking a look at http://www.discourse.org/ instead which is a much more modern take on forum software.

[... 46 words]

How does a web page interact with a server to parse a dynamic JSON file?

If you’re only dealing with 60 records there’s no need to add a full database. I’ve actually hand coded a 50 record JSON file before and it was fine- use an editor with good JSON support (I like Sublime Text 2) and it’s pretty easy to hand write.

[... 103 words]

What’s the best way to handle logins?

First, make sure you’re storing the password as a salted hash, using a deliberately slow hashing algorithm such as bcrypt, scrypt or PBKDF2—here are some recent articles to get you up to speed:

[... 176 words]

How do you change page content and URL without reloading the whole page?

This can only be done using JavaScript. You use XMLHttpRequest to pull in new information from the server (also known as Ajax—most people use a JavaScript library such as jQuery to handle this) and then use the HTML5 history API, in particular the pushState method, to update the URL.

[... 133 words]

Why do websites contain multiple webpages when they could use AJAX?

Because it shouldn’t require a full-blown JavaScript interpreter just to access content on the Web.

[... 32 words]

Why do browsers allow cross-domain JavaScript to execute but not XMLHttpRequests?

It’s called the Same Origin Policy, and it’s principally about intranets. Imagine you have a URL http://intranet.corp/top-secret-...—and you then visit http://evil.example.com/ . If cross domain XHR was allowed the evil site could suck that secret document off your intranet without you realising.

[... 105 words]

If I have data that loads using  json / JavaScript will it get indexed by Google?

No. Personally I dislike sites with content that is only accessible through JavaScript, but if you absolutely insist on doing this you should look in to implementing the Google Ajax Crawling mechanism: http://code.google.com/web/ajaxc...

[... 56 words]

Yahoo!’s new twist on mapping APIs

One of the most exciting things I’ve seen at Yahoo! since starting here has finally been made public: the new Yahoo Maps. The map application itself differs from many other recent map sites in being rendered entirely in Flash. This leaves far more scope for interface niceties, but doesn’t it reduce the scope for hacking that made things like Google Maps so much fun?

[... 623 words]

Why the term Ajax is useful

Software design patterns are useful mainly because they provide a shared vocabulary: rather than discussing the intimate details of a three layered application architecture, we say “MVC”. Rather than describing an object that tracks your progress while looping over a collection, we say “Iterator”.

[... 152 words]