I need to get the whole path of page (excluding the domain) so I can show it in an iframe.
I currently use location.pathname
to get the path, but the problem is that they may appear GET
variables in the URL.
So for a page like article.php?id=23
I get only article.php
using location.pathname
, thus the page displayed in the iframe
is simply a 404 page.
Is there any function to get the path including GET variables?