reusable other window

Discussion in 'Javascript' started by Matej, Mar 1, 2006.

  1. Matej

    Matej Guest

    Hi,

    I am here working with browser-based application (quite complicated),
    where I work on some plans in one window and then I need for every plan
    open other window (HREF of which can be calculated from the current
    HREF) to take a look at some data. There are hundreds of such plans so
    I would like to be able to manipulate other-data window with keyboard.

    So far I have created this with Greasemonkey:

    (function() {

    var ATags = document.getElementsByTagName("a");
    var hrefArray = window.location.href.split("/");
    hrefArray[hrefArray.length-1] = "gallery";
    var imageHREF = hrefArray.join("/");

    for (var i = 0; i < ATags.length; i++)
    {
    tempElem = ATags;
    if (tempElem.getAttribute("href") == imageHREF) {
    tempElem.setAttribute("accesskey","I");
    tempElem.setAttribute("target","_blank");
    }
    };


    })();

    But I would love to be able to reuse that data window. I know that I
    cannot control random other window with JavaScript, but could I somehow
    create new window and to store its handle via GM_setValue for later
    reuse? Did anybody see anything like this?

    Thanks a lot,

    Matej
    Matej, Mar 1, 2006
    #1
    1. Advertising

  2. Matej

    Matej Guest

    Other question on the same theme. Why this doesn't work (I would expect
    msgbox to jump on pressing Alt-L)?

    function openNewLocation() {
    alert("OK");
    }

    var ATags = document.getElementsByTagName("a");
    var hrefArray = window.location.href.split("/");
    hrefArray[hrefArray.length-1] = "gallery";
    var imageHREF = hrefArray.join("/");

    // window.open(this.href,'extern').focus();return false"
    // http://cingular.rbmfrontline.com/locations

    for (var i = 0; i < ATags.length; i++)
    {
    tempElem = ATags;
    if (tempElem.getAttribute("href") ==
    "http://cingular.rbmfrontline.com/locations") {
    tempElem.setAttribute("accesskey","L");
    tempElem.setAttribute("onpress","javascript:eek:penNewLocation();");
    }
    };

    Thanks for any reply?

    Matej
    Matej, Mar 1, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nikki
    Replies:
    3
    Views:
    483
    Nikki
    Jul 2, 2003
  2. Richard K Bethell

    datagrid as reusable datasource?

    Richard K Bethell, Nov 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    346
    Jacob Yang [MSFT]
    Dec 1, 2003
  3. Danny

    Reusable functions

    Danny, Jan 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    567
    Danny
    Jan 15, 2004
  4. Bijoy Naick

    Reusable Components

    Bijoy Naick, Nov 9, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    366
    Steve C. Orr [MVP, MCSD]
    Nov 11, 2004
  5. Bhasker V Kode
    Replies:
    0
    Views:
    98
    Bhasker V Kode
    May 26, 2007
Loading...

Share This Page