var url = location.href;
if(url == 'http://site.com/page/1') document.write('This is page №1');
else if(url == 'http://site.com/page/2') document.write('This is page №2');
else if(url == 'http://site.com/page/3') document.write('This is page №3');
Но ещё лучше, сделать через объект:
var urls = {
'http://site.com/page/1' : 'This is page №1',
'http://site.com/page/2' : 'This is page №2',
'http://site.com/page/3' : 'This is page №3'
}
document.write(urls[location.href]);