Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread TBrowser.OnLoad not fired when content is served by PHP script
Wed, Sep 30 2015 8:05 AMPermanent Link

PA

procedure TForm1.Browser1Load(Sender: TObject);
begin
 ShowMessage('test');
end;

OK: When Browser1.URL is a normal HTTP address then the OnLoad event is fired.

Problem: When the browser content is served by a PHP script then the HTML content is displayed normally in Browser1, but the OnLoad event is NOT fired! Why?
Wed, Sep 30 2015 8:52 AMPermanent Link

Matthew Jones

PA wrote:

> Problem: When the browser content is served by a PHP script then the
> HTML content is displayed normally in Browser1, but the OnLoad event
> is NOT fired! Why?

It should be the same, since the script is irrelevant. Check the
browser debug info to see what the headers etc say.

--

Matthew Jones
Wed, Sep 30 2015 9:11 AMPermanent Link

PA

I am not sure what you mean with: "Check the browser debug info to see what the headers etc say".

Can I send you the PHP URL as a private message?
Wed, Sep 30 2015 9:31 AMPermanent Link

Raul

Team Elevate Team Elevate

On 9/30/2015 8:05 AM, PA wrote:
> OK: When Browser1.URL is a normal HTTP address then the OnLoad event is fired.
> Problem: When the browser content is served by a PHP script then the HTML content is displayed normally in Browser1, but the OnLoad event is NOT fired! Why?

Unfortunately this can be browser specific - are you running IE (if
you're running it in EWB it's IE)?

For example using IE and doing :

Browser1.URL := 'http://www.thinkwithportals.com/media_19.php';

i do get the OnLoad event fired (and checking the Loaded property shows
it's true).

Some other googled random URL :

Browser1.URL := 'http://www.opensourcecms.com/script/show.php?catid=1')

Does not result in onload firing and checking the Loaded property shows
that is false as well.


Both sites (meaning the exact same EWB app) works fine in Chrome and
Firefox.

Raul





Wed, Sep 30 2015 10:14 AMPermanent Link

Matthew Jones

PA wrote:

> I am not sure what you mean with: "Check the browser debug info to
> see what the headers etc say".
>
> Can I send you the PHP URL as a private message?

Decent browsers have debug tools to allow you to see all the details of
what is happening in them. In Chrome, which seems to have the best
tools, you press F12. You can then see all the transactions that are
happening, and the responses etc. You can also breakpoint the OnLoad or
other such events and see what they are up to.

--

Matthew Jones
Wed, Sep 30 2015 11:19 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

PA,

<< OK: When Browser1.URL is a normal HTTP address then the OnLoad event is fired.

Problem: When the browser content is served by a PHP script then the HTML content is displayed normally in Browser1, but the OnLoad event is NOT fired! Why? >>

It doesn't have anything to do with the actual URL.  Did you set the OnLoad event handler in code, or at design-time ?  Also, which version of EWB are you using ?

Finally, can you email me an example, or email me the URL ?

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Sep 30 2015 6:25 PMPermanent Link

PA

I have discovered that this website has a lot of script errors. So it is their fault.
Image