I do have an URL which opens a webpage which is very slow to load and I have no control over it.
I do want to display a loading dialog when someone clicks this URL or to
You can do this :
$(function(){
$('a').click(function(){
$('loading...').prependTo(document.body);
});
});
Demonstration (change the link to a very slow page for best effect)
But it depends on the page : if the page sends immediately some content but not the whole content, you won't have the time to see your div.