Forum Discussion
VectorworksTrai
7 years agoCommunity Member
Open Link in Same Tab
I've seen this discussed before, but I have not found a clear answer. I need a link to open in the same tab as the rise course. Essentially, this will exit the course and go to a page of my choosin...
CoreyCallahan-a
6 years agoCommunity Member
If you're comfortable with vanilla Javascript, you can add this on your exported page within a script tag. It seeks out any anchor tags with a specific domain and swaps out the "_blank" target attribute with "_self". I've put a timeout on it, because even though I'm firing this after the DOM loaded, it didn't seem to work without a delay.
var domReady = function(callback) {
document.readyState === "interactive" || document.readyState === "complete" ? callback() : document.addEventListener("DOMContentLoaded", callback);
};
domReady(function(){
setTimeout(function(){
var nldLinks = document.querySelectorAll("a[href='https://yourdomain.com/']");
for (var i = nldLinks.length - 1; i >= 0; i--) {
nldLinks[i].setAttribute("target","_self");
}
},1000)
})FrankHansmann-b
6 years agoCommunity Member
Dear Corey,
I tried your script tag but it didn't work. Would it be possible to get some more details?
Related Content
- 6 months ago
- 6 months ago
- 8 months ago
- 12 months ago