Sign in to follow this  
Followers 0

_IELinkClickByText

4 posts in this topic

Posted

Hello,

I have some problems to "Click" on Text Links wich contains no href attribute, but only a 'onclick' event:

<tr><td><a onclick="jump('character');" style="cursor:pointer;">Character</a>	</td>

Why can't I get acces to this Link by:

_IELinkClickByText ($oIE_game, "Character",0,0)
_IELoadWait ($oIE_game, 20, 3000)

ist there any workaround?

I tried it with _IELinkGetCollection but there are also these links missing....

with _IETagNameGetCollection ($oIE_game, "a") I am able to get all "a" tags, but then is the question - how do i get access to the specific onclick-attribute (?) - and how can i simulate a klick on it? :P

thanks in advance

best regards

amon

Share this post


Link to post
Share on other sites



Posted

Hello,

I have some problems to "Click" on Text Links wich contains no href attribute, but only a 'onclick' event:

<tr><td><a onclick="jump('character');" style="cursor:pointer;">Character</a>	</td>

Why can't I get acces to this Link by:

_IELinkClickByText ($oIE_game, "Character",0,0)
_IELoadWait ($oIE_game, 20, 3000)

ist there any workaround?

I tried it with _IELinkGetCollection but there are also these links missing....

with _IETagNameGetCollection ($oIE_game, "a") I am able to get all "a" tags, but then is the question - how do i get access to the specific onclick-attribute (?) - and how can i simulate a klick on it? :P

thanks in advance

best regards

amon

_IELinkClickByText and _IELinkGetCollection use the document.links collection. This collection is defined as "A collection of all a and area elements that have assigned href attributes that make them behave as links (instead of only anchors)". So what you describe makes sense.

Your approach to this will need to use the _IETagNameGetCollection function just as you have and will need to look something like this:

$oLinks = _IETagNameGetCollection ($oIE_game, "a")
For $oLink in $oLinks
    If $oLink.innerText = "Character" Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next

Dale

Share this post


Link to post
Share on other sites

Posted

Your approach to this will need to use the _IETagNameGetCollection function just as you have and will need to look something like this:

$oLinks = _IETagNameGetCollection ($oIE_game, "a")
For $oLink in $oLinks
    If $oLink.innerText = "Character" Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next

Dale

Thank you for your hint, it just needed a tiny completion:

If string($oLink.innerHTML) = "Character" Then

I must be converted to a string, otherwise it returns 0 / NULL

best regards

Amon

Share this post


Link to post
Share on other sites

Posted

Thank you for your hint, it just needed a tiny completion:

If string($oLink.innerHTML) = "Character" Then

I must be converted to a string, otherwise it returns 0 / NULL

best regards

Amon

Ah yes, i do that in the UDF but easily forget about it. If the property is NULL, it returns numeric 0... a numeric comparison of 0 to any string returns True. Good catch.

Dale

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0