views:

77

answers:

2

I'm trying to bypass going through a bunch of menus, to get to the data I want directly.

Here are the links I want to go to:

Notice, if you pull that up right now, you simply see a GIF outline of the map, however there is no map data "behind" it.

However, if you go to: factfinder.census.gov/servlet/DTGeoSearchByListServlet?ds_name=DEC_2000_SF1_U&_lang=en&_ts=288392632118

  1. Select Geographic Type: ..... ..... Census Tract
  2. Select a State: Washington
  3. Select a County: Pierce
  4. Select one or more geographic areas: Census Tract 729.04
  5. Hit "Map It"

The map will load perfectly. Also, until you close your browser, any of the other links will work perfectly. What I want to do, is be able to bypass these 5 steps, but obviously something is preventing this. Is there a feasible workaround? I have my own domain that I would be able to upload new Javascript or HTML files or whatever is needed.

+1  A: 

This is not quite a js solution, but can I recommend using the Imacros plugin(works with firefox,chrome and IE) for this?

It lets you record macros to interact with websites and you can write javascript to process web content.

Charles Ma
Thanks! I'll look into it. The main reason I'm looking for a simpler solution is to aid less than tech-savy users. I understand not closing a browser window, but I'd love it, if I could send a direct link to someone. Even if that direct link had to go through some sort of proxy.
Mikey
+1  A: 

Looking at the relevant code, there's only a few functions that are needed. The "Map it" button calls the mapit function with a string literal of '/servlet/MapItDrawServlet'.

    function launchMapItServlet(mapItServlet) {
    context = document.form1.context.value;
    lang = "en";
    url = mapItServlet + "?geo_id=" + geo + "&" + "tree_id=" + tree_id + "&context=" + context + "&_lang=" + lang;
    url = getAFFWindowLocation(url, true);
    windowCtr++;
    window.open(url, "identify" + windowCtr, "menubar=yes,scrollbars=yes,resizable=yes,top=10,left=10,width=750,height=550");
}

   function mapItMulti(servlet) {
    if (numberOfSelections(document.forms["form1"].search_results) == 0 || numberOfSelections(document.forms["form1"].search_results) > 1) {
        alert(ALERT_MSG1);
    }
    else if (canMapItMulti(document.forms["form1"].search_results)) {
        index = document.forms["form1"].search_results.selectedIndex;
        geo = document.forms["form1"].search_results.options[index].value;
        tree_id = document.form1["tree_id"].value;
        launchMapItServlet(servlet);
    }
    else {
        alert(ALERT_MSG1);
    }
}

function mapit(mapItServlet) {
    geo = "";

    mapItMulti(mapItServlet);

}

Notice the window.open function which will be the relevant information that you will want to use, especially the 'url' variable.

Nitrodist
Nitrodist
I'm guessing there is a variable being cached, or something server side I'm missing. Another piece of info I just found out, is the other links will work until the browser is closed, or after 60 minutes. I don't know enough (see also: anything) about javascript to try and isolate what's causing this.
Mikey