Suggestions
|
|
Hi, Nice idea, you may continue... I submit
Study my script to detect current city and view page. And kChen script success define links to select another city with new view ;o) |
|
|
Thank you very much |
|
|
First, not use document.URL to detect current "view" because some pages use form with POST method But body "id" equal current building name or page "view".
try
{
var body_id = document.getElementsByTagName("body")[0].id;
window.status = 'body.id=' + body_id;
}
catch (e)
{
var body_id = '';
var url_view = /[\?&]view=([a-zA-Z0-9\-_]+)/.exec(document.URL);
if (url_view != null) body_id = RegExp.$1;
window.status = 'body.id not found, view=' + body_id;
if (body_id == '') { window.status = 'body.id and view not found'; }
}
In kChen script, study table.js file which have function to change current city ; we may send http request (with POST method) to change current city before to open building URL ;o) In my script, study how I get city_id (id of current city in header) and how I obtain city's ID (and island ID) of city's name you fetch in "mainview" tag. Good luck ^^ |