Action triggering Javascript function on webpage?

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
FhemPiUser
Posts: 7
Joined: 17 Aug 2016 17:58

Action triggering Javascript function on webpage?

Post by FhemPiUser » 21 Aug 2016 08:27

Hi all,

I'd like to have an action to jump to another DOM element on my webpage that is already open in the browser without reloading the webpage. Is this somehow possible?

It would also be possible to define a javascript function for that on my webpage. Is it possible to trigger a javascript function of a webpage in a browser using an automagic action?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Action triggering Javascript function on webpage?

Post by Martin » 21 Aug 2016 13:55

Hi,

You can probably achieve this with a Bookmarklet respectively by calling a javascript function directly from the address bar:
https://en.wikipedia.org/wiki/Bookmarklet

You can try to use action Control UI to enter the text into the address bar.

Regards,
Martin

FhemPiUser
Posts: 7
Joined: 17 Aug 2016 17:58

Re: Action triggering Javascript function on webpage?

Post by FhemPiUser » 22 Aug 2016 19:38

wow, control ui seems to be a powerful action, it should do the job. i could trigger a click x,y to click an internal link (#...) to get to another location of the webpage.

what is the id in clickbyid ? is it the dom element id of an html page?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Action triggering Javascript function on webpage?

Post by Martin » 26 Aug 2016 19:42

You can use Show Overlay Control to show an info button at the top of the screen. Open the web page in question and press the info-button to see the control elements highlighted with a green border. You can click the highlighted elements to get a few example functions like click(x, y). It will also show a function clickById(..) if it's supported on this element.

Regards,
Martin

Locked