Javascript needed (pushState, popState, replaceState, or?)

Job Description:

I have a web page (attached) that opens modal popups for audios, videos, and multiple levels of text. Clicking ESCAPE calls a function that closes one popup (just one level). If there are more than two popups open, it closes the top one.

REQUEST: I want the browser back button to do the same thing as clicking "Escape". In other words, I want the browser back button to have the effect of closing one popup.

HOWEVER: If there are no popups open, then clicking the back button should take user away from the page. Therefore, using a [login to view URL] method won't work here. Such a solution would lose all modal/popup levels anyway.

I believe the solution needs some combination of pushState, popState, replaceState, and/or perhaps something I'm not aware of.

*This is a request for JavaScript. Please NOT jQuery.

At minimum, the solution should work on Firefox and Chrome. And preferably Safari, but that's not required.

Skills: JavaScript, AJAX

About the Client:
( 261 reviews ) San Francisco, United States

Project ID: #36259296

16 freelancers are bidding on average $40 for this job


Hello sir, I will modify your javascript not jquery to solve the popup issue and I will add clean code to make it work. I will also check each browser chrome, firefox, safari then I will deliver it to you. Regard's

$30 USD in 2 days
(20 Reviews)

Hi, how are you? I am a professional web developer with more than 6+ years of experience. I have strong knowledge of web development using NodeJS. In addition, I also have good experience with JS frameworks such as Re More

$30 USD in 1 day
(12 Reviews)

Hey, I read your requirements, I can do this for you, have prior experience working with such tasks. Let me know if you are interested, I will be more happy to serve you. Sincerely Rajesh

$150 USD in 7 days
(7 Reviews)

I have more than 10 years of experience working with PHP, CodeIgniter, Prestashop, Laravel, MySQL, PostgreSQL, API, HTML, Javascript, Node Js, Vue Js Css, Git, C#, TLV, QR Code, BarCode, SQL Server, Devexpress, and int More

$30 USD in 2 days
(10 Reviews)

Hello There, I am excited to offer my services as a JavaScript developer for your web page project. I understand that you need the browser back button to function as the "Escape" button, closing one popup at a time. I More

$30 USD in 7 days
(3 Reviews)

Greetings! I have read your description carefully and understand what you actually need. I am an experienced developer and can handle this project easily and in perfect manner. I am available now and can start right aw More

$50 USD in 2 days
(0 Reviews)

Greetings ✋ I just read your posting I will do this project according to your requirements.☑️ I can provide you immaculate quality work that can add valuce in your audience and is budget-friendly.✅ Kindly share your s More

$23 USD in 7 days
(0 Reviews)

Dear Sir, Thank you for considering me for your project. I understand that you have a web page with modal popups for audios, videos, and multiple levels of text, and you require a JavaScript solution that makes the br More

$23 USD in 7 days
(0 Reviews)

Dear Client, I am excited to submit my proposal for the Project posted on Freelancer. As an experienced in Javascript, I believe I have the skills and expertise required to deliver high-quality work on this project. More

$23 USD in 9 days
(0 Reviews)