Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140817

Trigger a function after opening a page

$
0
0

I am working on a website where users click on links to other websites. I am working with jquery I want to make a call to database ONLY when the page fully loads !. So this is where my code open a link


$(".link").click(function(){
 let link = $(this).attr("data-link");

window.open(link,'_blank','width=300,height=300');


})

I tryed this :

window.open(link,'_blank','width=300,height=300').then(()=>{ ACTION });
//and this
window.open(link,'_blank','width=300,height=300').onload = function(){ action };

But both ways didn't work


Viewing all articles
Browse latest Browse all 140817

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>