Lessons

Redirecting JavaScript code

Redirection is a situation where a page itself initiates a transition to another page, like a user clicking on a link with a mouse.

They are used, for example, to change the connection from HTTP to secure HTTPS. Or from a domain with the prefix “www” to a page without one.

It is better to do redirects through the Location header, rather than JavaScript code, since in the first case it happens much faster. In the second case, the page loads completely, and the user spends more time redirecting.

List of functions that redirect the user or refresh the page:

/*Страницу обновляют следующие функции*/
location.reload();
history.back();
history.forward();
history.go(0);
location.replace("https://example.com");
location.href = "https://example.com";
location.assign("https://example.com");

/*Так же страницу можно обновить через симуляцию клика по ссылке.*/
var a = document.createElement('a');
a.href = "https://example.com";
a.click();

/*Бывают код специально подготавливается таким образом, чтобы его невозможно было найти через текстовый поиск по названию функции.*/
location["reload"]();
location["r"+"e"+"l"+"o"+"a"+"d"]();
eval('location.r'+'e'+'l'+'o'+'a'+'d();');
/*В таком поиск кода, обновляющую страницу может затянуться.*/

Tariff plans for working with the service

Additional pages

For an active subscription
spend during the year
Any website
*0.3 - 3₽ / 1 page

Additional pages for the Subscription plan.

Adding funds via your merchant profile.

*The price depends on the active subscription. The more expensive the tariff, the cheaper the additional pages.

We use cookies. By continuing to use the site, you agree to the processing of personal data in accordance with privacy policy. I agree