การคัดลอกรหัสมีดังนี้:
var system = {};
var p = navigator.platform;
System.win = P.indexof ("win") == 0;
System.mac = P.indexof ("Mac") == 0;
System.x11 = (p == "x11") || (P.indexof ("Linux") == 0);
if (system.win || system.mac || system.xll) {// ถ้าเป็นคอมพิวเตอร์ให้ข้ามไปที่ Baidu
window.location.href = "http://www.baidu.com/";
} else {// ถ้าเป็นโทรศัพท์มือถือให้ข้ามไปที่ Google
window.location.href = "http://www.google.cn/";
-