Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

243
Views
How to detect if a page is loaded into a named window?

Ok, I posted this question a month ago. Now I think I can rephrase it a bit, and maybe someone can understand my issue somewhat better now.

We´re using named windows to reuse tabs when the user is opening several links of the same type. Links to different products all open in a window named Products <a href='somepage' target='Product'>Product B</a>. Other collections leading to windows named Org.Info, News and so on.

The window name is displayed in the top bar for any "Named" window using this code in our shared layout-page.

<span id="windowname"></span>
    
<script>
        if (window.name.length > 0) {
            $('#windowname').text('Window: ' + window.name);
        }
</script>

All is working well, the window name is showing if it isn't empty, and the tab is reused as expected.

But if the user continue to browse in this named window I want the window.name to be cleared again, when the next page is loaded.

I tried with this script to clear it on window.unload, and it clear the window.name, but then the window reusing isn´t working anymore.

window.onunload = function () {
    window.name = '';
}

Is there a way to clear the name, only if the call doesn´t have a target window specified?

Something like this?

window.onunload = function () {
if(the call to open a new page in this window has a target.value !=window.name){
    window.name = target.value'';
}
}
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!