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

76
Views
How to create a function in javascript that generates a breadcrumbs taking both the visible content in url and the page loaded inside the Iframe tags

I have a page called sem_menu.html which contains an iframe:

    <div class="container_frame">
        <iframe id="frameapplication" name="frameapplication" scrolling="no" src="sem_menu2.html" style="width: 100%;height:1000px;border:0px"></iframe>
    </div>

And a div with id "breadcrumbs" in which inside I need to load all the url path that the user does with the data passed in url and in iframe

    <div id="breadcrumbs">
        <i class="fa fa-home icon_breadcrubs fa-sm"></i>
    </div>

I tried a function but it doesn't seem to work, is there anyone who can help me? A thousand thanks!

function getBreadcrumbs() {
    var lease = location.href.split('/').slice(3);
    var parts = [{
        "text": '<a href="sem_menu.html"><i class="fa fa-home icon_breadcrubs fa-sm"></i>' + 'Home' + '</a>',
        "link": '/'
    }];
    for (let i = 0; i < lease.length; i++) {
        var part = lease[i];
        var text = decodeURIComponent(part).split('.')[0];
        var link = '/' + lease.slice(0, i + 1).join('/');
        console.log(link);
        parts.push({
            "text": text,
            "link": link
        });
    }
    return parts.map((part) => {
        return "<a href=\"" + part.link + "\">" + part.text + "</a>";
    }).join('<span style="color:#7c7c7c">/</span>');
}
document.getElementById("breadcrumbs").innerHTML = getBreadcrumbs();
about 4 years ago · Juan Pablo Isaza
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!