When you use Google Videos, you will notice the right part of the page stays still when you search videos on the left. How is it implemented?
Asked
Active
Viewed 58 times
1
-
Similar intent: http://stackoverflow.com/questions/1568312/facebook-style-ajax-search – Piskvor left the building Nov 04 '09 at 14:33
1 Answers
0
using ajax
http://www.google.com/search?q=ajax+tutorial
edit:
function $(id) { return document.getElementById(id); }
function getHTTPObject() {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
}
function AJAX_GetAsinc(ajax, id, url) {
ajax.abort();
function statechange() {
if ((ajax.readyState==4) && (ajax.status==200)) $(id).innerHTML=ajax.responseText;
}
ajax.open('GET', url, true);
ajax.onreadystatechange = statechange;
ajax.send(null);
}
usage:
var a = getHTTPObject();
AJAX_GetAsinc(a, 'YOUR_DIV_ID', 'mycontent.php');
or:
use jQuery or your favourite framework/library
Hope it's specific enough

Peter
- 5,138
- 5
- 29
- 38
-
ajax_search.post();ajax_search.onresponse(leftdiv.replace());//anything more detailed is implementation specific, see the GV page source for **exact** details – Piskvor left the building Nov 04 '09 at 14:15