URL from Embedded iFrame

Forum to discuss the new web client version of Servoy.

URL from Embedded iFrame

Postby Gordon McLean » Tue Dec 05, 2017 1:24 pm

Hi
Are any of you aware of a way to get the URL of a parent site that is loading a servoy NG solution into an iFrame ?

Essentially I have a multi tenant solution that I need to switch based on the client loading it. In order to avoid using a Combo Box where the user selects the company concerned I want to extract this from the URL they are using to access the site ie clickdigital.com or servoy.com is this possible ?

effectively I want document.URL that would be triggered using javascript in a native html page.

Many thanks
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 219
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: URL from Embedded iFrame

Postby Andrei Costescu » Thu Jan 04, 2018 7:40 pm

If it is something that could be retrieved using javascript inside the iframe you can make an NG service that executes whatever you want.
You create a service. Add a method to it that executes client side and returns stuff to the server.

If you need more info let me know.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 939
Joined: Tue Jun 26, 2007 3:14 pm

Re: URL from Embedded iFrame

Postby Andrei Costescu » Thu Jan 04, 2018 7:45 pm

About accessing the parent's URL from inside the iFrame: https://stackoverflow.com/questions/342 ... rom-iframe
So basically you won't be able to do it unless both parent and iFrame are part of the same domain.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 939
Joined: Tue Jun 26, 2007 3:14 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 2 guests