Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread How can an app find its host server?
Thu, Jun 7 2012 8:49 AMPermanent Link

Matthew Jones

Any users able to help me with how an EWB application can know which host it was
loaded from? I'd like to create a generic application that makes REST calls to its
parent host. How might I find the "parent" URL? Anyone know?

/Matthew Jones/
Thu, Jun 7 2012 10:50 AMPermanent Link

Matthew Jones

And if anyone does know, then I'll extend that to how one can find out about the
"page" you are running on. I recall wanting to know something else, so a general
page access "object" would be handy.

/Matthew Jones/
Thu, Jun 7 2012 11:29 AMPermanent Link

Mark Brooks

Slikware

Avatar

(Matthew Jones) wrote:

>>And if anyone does know, then I'll extend that to how one can find out about the
>>"page" you are running on. I recall wanting to know something else, so a general
>>page access "object" would be handy.

Hi Matthew,

If you take a look at the WebDOM unit The TWindow class has a location property of type TLocation. This in turn contains host, hostname, protocol etc. Should be what you need.

Cheers
Mark
Fri, Jun 8 2012 3:49 AMPermanent Link

Matthew Jones

TVM - is there an object available for TWindow? Perhaps a global, or
Application.Window or something? I'll make time to look today.

/Matthew Jones/
Fri, Jun 8 2012 8:56 AMPermanent Link

Raul

Team Elevate Team Elevate

As long as WedDom unit is included you can just reference these directly
in your code :

window.location.hostname
window.location.host
window.location.href
window.location.pathname
window.location.port
etc

The last one is blank if 80 i believe

Raul

On 6/8/2012 3:49 AM, (Matthew Jones) wrote:
> TVM - is there an object available for TWindow? Perhaps a global, or
> Application.Window or something? I'll make time to look today.
>
> /Matthew Jones/
Mon, Jun 11 2012 6:01 AMPermanent Link

Matthew Jones

These work fine - many thanks.

/Matthew Jones/
Image