browserClick: minor glitch in Dictionary?

Interested adding compiled externals from LiveCode and third parties to your LiveCode projects? This is the place to talk about them.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sp27
Posts: 135
Joined: Mon May 09, 2011 3:01 pm

browserClick: minor glitch in Dictionary?

Post by sp27 » Sun May 29, 2011 10:52 pm

In the entry for browserClick, the LC Dictionary (4.6.1) says this:
The browserClick message is sent to the current card of a stack containing a browser object when the mouse is clicked in the browser.

The instanceId is the integer identifier of the browser object
The elementId is the id of the html element that was clicked

The browserClick message is only sent if advanced browser messages are turned on. To turn on advanced browser messages use the following command:

revBrowserSet <instanceId>, "messages", "true"

The browserClick message is currently only available on Windows.

The id of an html element is the element's "id" attribute. For example <div id="navbar">. As this attribute is optional in most cases, not all html elements will have an id. If the html element that the mouse was clicked over does not have an id, then the elementId parameter will be empty.
In my tests, the last sentence of this description is not quite accurate: I find that if the clicked HTML element doesn't have an id, the message is not sent at all--at least I cannot detect it. I have this in the card stack where the revBrowser is instantiated:

Code: Select all

on browserClick pBrowserID, pElementID --this message is sent only in Windows
   answer "You clicked HTML element whose ID is " & pElementID & " in browser " & pBrowserID
end browserClick
When I click an element with an ID, I see the answer box, with everything in it. When I click an element w/o an ID, the answer box doesn't come up.
If I'm misinterpreting something here, perhaps someone will correct me.

sp27

Post Reply

Return to “Using Externals”