manipulating frame url by script - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9) +--- Thread: manipulating frame url by script (/showthread.php?tid=1212) |
manipulating frame url by script - schippi - 04.02.2018 Hello, I'm using homeLYnk (2.0.1) in a camper, so it's mobile. I have already the actual position (latitude and longitude) in two different KNX objects. Now I want to show the actual position in a frame with an URL like this: http://osmand.net/go.html?lat=37.47498&lon=-7.4746356&z=15. But, of course, this URL is static so the position will never change. How can i manipulate the frames url by script to see always my actual position? B. r. in advance, Uwe RE: manipulating frame url by script - Erwin van der Zwart - 04.02.2018 Hi Uwe, Create a frame and give it the additional class "position" and create 3 objects where your LON, LAT and ZOOM variables are written to and create this custom JS: Code: $(function(){ This will update the URL in the frame as soon as one of the 3 object values are changing, it happens client side so no refresh of the client is needed. BR, Erwin RE: manipulating frame url by script - schippi - 04.02.2018 Hello Erwin, hope you're well ! Thanks for the very quick response. It seems that sundays are disabled in the netherlands ? I'll follow your instructions and give you a short feedback. B.r., Uwe RE: manipulating frame url by script - Erwin van der Zwart - 04.02.2018 Hi Uwe, Yes i’m very well, hope you to after leaving us, so i asume you have holiday 24/7 with your camper ?. We live in a 24/7 economy so i adapted to that standard (: Greatings, Erwin RE: manipulating frame url by script - schippi - 06.02.2018 Hello Erwin, your instructions are working perfect! Thank's again. On more question: when my camper don't move and I open this page the old URL is valid again and the frame shows an old position and not the actual one.
Uwe RE: manipulating frame url by script - Erwin van der Zwart - 06.02.2018 Hi Uwe, Hmm that is strange as the script should request the actual object values on start.. Try adding this to the custom JS also: Code: $(function(){ Erwin RE: manipulating frame url by script - schippi - 06.02.2018 Hi Erwin, I added this code, but unfortunately the behaviour doesn't change. Without changing the object values (in lon, lat or zoom) the frame shows an old position on opening the page with this frame in it. When I open the page in edit mode the frames source URL is also the old one instead of the actual one. It seems that the code changes the src (URL) only temporary. Uwe PS: the existing code: Code: $(function(){ RE: manipulating frame url by script - Gadjoken - 13.01.2022 Hello, Did you manage to update your url from this script? Indeed I am trying to display a URL contained in a string type object and I cannot update the FRAME from this JS. here is my script: Code: $(function(){ I did add in Additional classes testurl but the FRAME remains on the URL that I entered manually in the object (34/1/1). Thanks for your feedback. B.R. RE: manipulating frame url by script - admin - 13.01.2022 This will only change the url once on load. You need to use grp.listen to update it dynamically. RE: manipulating frame url by script - Gadjoken - 13.01.2022 Hello, I had also tested this script but nothing helped the url always remains the one I entered manually and is not updated based on the subject. Code: $(function(){ <div class="item testurl item-iframe" style="top: -1px; left: -1px; z-index: 10; width: 1025px; height: 769px;"><iframe border="0" frameborder="0" width="1025" height="769" src="https://xxxxxx"></iframe></div> This is what I get when I inspect the iframe I have also tried on several browsers. B.R. RE: manipulating frame url by script - admin - 14.01.2022 Use this code and also enable "Persistent" mode for the iframe: Code: $(function(){ RE: manipulating frame url by script - Gadjoken - 14.01.2022 Thank you it's perfect ! B.R. |