how to get url from console requests in javascript

2

I need to get the url of a get from the console I want to know this because I have an iframe that I need to get the url from a get of it only in the url there is a random variable that keeps changing whenever I give reload there is some way I get the direct url from the console

    
asked by anonymous 15.06.2016 / 23:54

1 answer

-1

You can get the parameters of the URL through the object, window, follow an example below.

There is also another function to get the parameters in the object format.

 function getQueryParams() {
   var queryParameters = window.location.search.split('+').join(' ');

   var params = {},
       tokens,
       re = /[?&]?([^=]+)=([^&]*)/g;

   while (tokens = re.exec(queryParameters)) {
     params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
   }

   return params;
 }
    
16.06.2016 / 00:14