2
you can get the URL parameters through the object, window, follow an example below.
Also follows another function to get the parameters in 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;
}
Elvis, welcome to [en.so]! In my view it’s not very clear what you’re looking for. The console logs requests so you can inspect, but it’s not something that is part of a page’s scope. You want to monitor the requests made by the
iframe
? Want to run something with this or just inspect it on the console? How are you doing this now? Please try to clarify these points so we can help you better.– utluiz
type this for example, I have an iframe on my page, this iframe makes a get, I need to get the url of this get more in this url has a variable that changes every time the page is visited and this variable works as a key understands, the variable is changed through the javascript of the iframe and as I can n change the code of the iframe n have to take this variable changed, the only way to achieve would be to get the console with all variables already certain
– Elvis
Unless you’re implementing an extension for Chrome, I don’t think you can access console information from your home page. Also, if your page is in a different domain than the
iframe
, then for security reasons it will be impossible for you to interact with it in Javascript.– utluiz
What type of variable do you refer to? Is it a URL parameter or a global page variable? If you have access to
iframe
, Assuming there are no security restrictions, you could list all variables and identify the name of that variable you are looking for. Or even if this request uses Jquery, you can add a hook to listen to AJAX requests. But you would have to know more details to say exactly what is possible and what is not.– utluiz
but iframe n lets me make modifications I’ll find some way to do it differently.
– Elvis