Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread passing parameters into EWB
Sat, Feb 13 2016 2:35 PMPermanent Link

erickengelke

Avatar

My first EWB app works perfectly after just a few hours, Kudos for a brilliant system for Delphi developers.

But I would like to pass a parameter to my EWB app from another web page that calls it.  How do I get parameters from the calling URL?

My guess was that someone mentioned windows.location, but I get errors when I try to reference it, how do I reference a global variable like Window?  

Or maybe something like ParamStr(), but that didn't seem to work either.

Thanks in advance.
Sat, Feb 13 2016 2:50 PMPermanent Link

erickengelke

Avatar

erickengelke wrote:

>But I would like to pass a parameter to my EWB app from another web page that calls it.  How do I get parameters >from the calling URL?

My attempt so far gets me the data, but also an error:
I added webdom to the uses clause
then
showmessage( window.location.search );
which gives the correct parameter string, but then gives the error:
 Error executing request: access to restricted URI denied

Erick
Sat, Feb 13 2016 2:57 PMPermanent Link

Matthew Jones

<erickengelke> wrote:
> My first EWB app works perfectly after just a few hours, Kudos for a
> brilliant system for Delphi developers.
>
> But I would like to pass a parameter to my EWB app from another web page
> that calls it.  How do I get parameters from the calling URL?
>
> My guess was that someone mentioned windows.location, but I get errors
> when I try to reference it, how do I reference a global variable like Window?  
>

I forget the exact line but it is something like window.something.search

It has been discussed here before, and is a standard browser thing. Google
or the EWB source will lead you to the proper items.

--
Matthew Jones
Sat, Feb 13 2016 2:58 PMPermanent Link

Matthew Jones

I see you got it. Just assign it to a string. I've not had trouble with it
as you describe.

--
Matthew Jones
Sat, Feb 13 2016 3:44 PMPermanent Link

Raul

Team Elevate Team Elevate

On 2/13/2016 2:50 PM, erickengelke wrote:
> My attempt so far gets me the data, but also an error:
> I added webdom to the uses clause
> then
> showmessage( window.location.search );
> which gives the correct parameter string, but then gives the error:
>    Error executing request: access to restricted URI denied

Seems to work fine here  - is your code trying to access anythign else
(to cause the error) ?

Or what exactly are you passing in as param(s) ?


Something like this works fine here without any errors:

procedure TForm1.Form1Create(Sender: TObject);
begin
   MultiLineEdit1.Lines.add(window.location.search);
end;

and shows the expected URL param string in edit window.


Raul
Sat, Feb 13 2016 4:42 PMPermanent Link

erickengelke

Avatar

Raul wrote:

On 2/13/2016 2:50 PM, erickengelke wrote:
> My attempt so far gets me the data, but also an error:
> I added webdom to the uses clause
> then
> showmessage( window.location.search );
> which gives the correct parameter string, but then gives the error:
>    Error executing request: access to restricted URI denied

::Seems to work fine here  - is your code trying to access anythign else

Yes, that works fine now.  Just as it should.

Erick
Image