hrefs and javascript, navigate and other beasties

D

Dudely

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
 
T

Thomas 'PointedEars' Lahn

Dudely said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top