hrefs and javascript, navigate and other beasties

Discussion in 'Javascript' started by Dudely, Oct 9, 2008.

  1. Dudely

    Dudely Guest

    Not sure if this is the right place to post, but here goes anyway. I
    pull out "javascript:__doPostBack('ctl01$ContentPlaceHolderMain
    $Page_SearchResults$Results','LID_2076923')" from an href in an object
    I'm parsing and set URLaddress to be that string

    On a whim, I then plug it into obIe.navigate (URLaddress) and miracle
    of miracles, it actually brought me to the right web page, which I
    didn't think it would do and have no idea why it actually works.
    Setting aside the issue of why it does work as well as it works,
    there's still a problem.
    It never enters readyState 4, but remains at readyState 3, so I never
    leave the loop.

    In VBA I do:
    obIe.navigate (URLaddress)
    Do While obIe.readyState <> 4 'READYSTATE_COMPLETE
    DoEvents
    Loop

    I can't figure out how to get past this. I'm sure it must have to do
    with the href string in some way since I didn't expect it to work at
    all.

    I was considering doing something like [myObject].href.onClick
    instead, but I would prefer to use the navigate method above for the
    simple reason that I believe I have more control over timing and
    errors - at least usually.

    Any help?

    Thank you
    Dudely, Oct 9, 2008
    #1
    1. Advertising

  2. Dudely wrote:
    > Not sure if this is the right place to post, but here goes anyway.


    "I don't care if this could interest you, but I bother you nonetheless."

    How very social of you. And yes, it was the right place -- *this* time.

    > I pull out "javascript:__doPostBack('ctl01$ContentPlaceHolderMain
    > $Page_SearchResults$Results','LID_2076923')" from an href in an object
    > I'm parsing and set URLaddress to be that string
    >
    > On a whim, I then plug it into obIe.navigate (URLaddress) and miracle
    > of miracles, it actually brought me to the right web page, which I
    > didn't think it would do and have no idea why it actually works.
    > [...]
    > obIe.navigate (URLaddress)


    `javascript:...' is a URI (if still a proprietary one), why should it *not*
    work with a method that appears to accept a URI and then to navigate to it?

    > [...]
    > It never enters readyState 4, but remains at readyState 3, so I never
    > leave the loop.


    Quite obvious, there is no direct HTTP request here.

    > In VBA I do:


    Visual Basic for Applications is obviously well beyond the scope of this
    newsgroup.

    > [...]
    > I was considering doing something like [myObject].href.onClick
    > instead, but I would prefer to use the navigate method above for the
    > simple reason that I believe I have more control over timing and
    > errors - at least usually.


    Usually you have more control over timing and errors if you employ a
    standards-compliant event listener instead of a proprietary URI scheme.


    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$>
    Thomas 'PointedEars' Lahn, Oct 9, 2008
    #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. Domestos

    HTML HREFS - confused...

    Domestos, Apr 23, 2006, in forum: HTML
    Replies:
    4
    Views:
    537
    frederick
    Apr 24, 2006
  2. Guest

    HTML, Scripts and HRefs, etc...

    Guest, Nov 27, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    412
    Walter Wang [MSFT]
    Nov 28, 2006
  3. Brian Vallelunga
    Replies:
    0
    Views:
    333
    Brian Vallelunga
    Jan 15, 2007
  4. Andy Fish

    alternative to javascript hrefs

    Andy Fish, Dec 18, 2003, in forum: Javascript
    Replies:
    6
    Views:
    149
    Andy Fish
    Dec 19, 2003
  5. Gagan  Diesh

    two hrefs and function call

    Gagan Diesh, Mar 15, 2005, in forum: Javascript
    Replies:
    4
    Views:
    95
    Gagan Diesh
    Mar 16, 2005
Loading...

Share This Page