+1 vote
by
Hello, everyone!
There is a domain domen.com and a subdomain poddomen.domen.com

The domain has links leading to the subdomain, depending on how you click on which subdomain should be either open or hidden (close) block

Link 1


Link 2



Lorem ipsum

.block {
display: none;
}
.block.open {
display: block;
}

Question: How do I transfer state parameters from a domain to a subdomain?

$('a').on('click', function () {
e.preventDefault();
location.href = $(this).getAttribute('href') + '?' +$(this).data('display');
});
by
.block {
display: none;
}
.block.open {
display: block;
}
When will you learn how to https://www.w3schools.com/tags/att_hidden.asp
by
Alex but its support is not perfect, ie10 is still needed

2 Answers

0 votes
by
 
Best answer
What's the problem?
<p><a href="poddomen.domen.com?display=open">Ссылка 1</a></p>
<p><a href="poddomen.domen.com?display=close">Ссылка 2</a></p>
+1 vote
by
I would just use cookies in the ".name.domain" domain. Such cookies, with a dot at the beginning, work throughout the domain with subdomains. Another option is to load a dynamic script from a subdomain in the domain. The script generator sees the contents of the session and generates a script that will show or hide the buttons.
...