Display URL from Component LOAD

34 views
Skip to first unread message

bria...@gmail.com

unread,
Jan 18, 2017, 12:46:00 PM1/18/17
to web2py-users
Hi,

I'm trying to display the current URL inside an html page that's embedded via Component LOAD.

However, the URL displayed is not the one that's on the browser's address bar. Instead, it's the URL of the embedded page.

How do I display the URL on the browser's address bar instead of itself?

Thanks,
Brian

Dave S

unread,
Jan 18, 2017, 2:05:16 PM1/18/17
to web2py-users
Can you use the referrer header from the request?  On my LOAD() example, FF inspect-element/network shows the parent page as the referrer.

/dps
 

Anthony

unread,
Jan 18, 2017, 5:15:26 PM1/18/17
to web2py-users
You could pass the URL via the "vars" argument to LOAD(), but it might be easier to simply use Javascript to grab window.location.

Anthony

Gaurav Vichare

unread,
Jan 18, 2017, 11:18:50 PM1/18/17
to web2py-users
Can you use the referrer header from the request?  On my LOAD() example, FF inspect-element/network shows the parent page as the referrer.

I have used request.env.http_referer to find link of parent page in load controller function, I don't know whether it's correct or not.
Reply all
Reply to author
Forward
0 new messages