Results 1 to 2 of 2

Thread: js call to anchor in <iframe.>

  1. #1
    Join Date
    May 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default js call to anchor in <iframe.>

    I am capturing from the request a value and want to find it in an iterited list i have in a jsp.

    I made an anchor statement <a name="(request.value)" and it's iterated in a td set in a table, producing exactly as it should. I want to though capture the last edited value (which im passing in the request) and find it in the list of anchor'd row's in the iterated table.

    so what i'm doing is

    var iam = document.userListFrm.lastEdited.value;
    if ( document.userListFrm.lastEdited.value == 'null') {
    alert('no one to find');
    }
    else {
    alert(iam );
    usersLister.location.href='document.userListFrm.lastEdited.value';
    }
    }

    usersLister is the name of the iframe. and the jsp loads the value in the hidden field lastEdited.

    anyone wanna let me know how i would call to the anchor, i used to use a goto command. not sure if it would be the best application here.

    DiGiTaL

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'd try:

    Code:
    usersLister.location.href='pageName.htm#'+document.userListFrm.lastEdited.value;
    where:

    pageName.htm

    is the actual name of the page and document.userListFrm.lastEdited.value is the anchor name. If the page is already loaded in the frame/iframe, then this might work:

    Code:
    usersLister.location.href='#'+document.userListFrm.lastEdited.value;
    The important thing to remember (as I'm not clear on what your variable document.userListFrm.lastEdited.value contains) is that in passing a variable to location.href=, it should not be quoted, if you put quotes around it, it becomes a literal string and no longer represents the value that it held.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •