R
R
Rafael™2016-11-29 10:04:54
JavaScript
Rafael™, 2016-11-29 10:04:54

Is this code crossbrowser?

there is a main window
and there is an iframe inside it,
the script inside the iframe checks if the urls match

if(decodeURIComponent(window.location) === decodeURIComponent(top.айфрейм.src) + '/')

on my machine (mac firefox mamp) I had to add a slash
everywhere will such a cat work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton fon Faust, 2016-11-29
@bubandos

And what about the browser?
See source code and server operation.
If you have src without a slash in your iframe, and adding a slash is installed on the server, then this is the only way it will work.
Because window.loation is overwritten when you visit the page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question