Option 1
You can place arbitrary content on the page almost anywhere, just by creating and adding absolutely positioned DOM elements, see this question for more information, but mostly
var element; element = document.createElement('div'); // Or whatever element.style.position = "absolute"; element.style.left = "100px"; element.style.top = "100px"; element.style.width = "200px"; element.style.height = "200px"; document.body.appendChild(element);
left
, top
, etc. can be any valid CSS values. You can also use z-index
to make sure it is displayed on top of other content.
Of course, when they click on it or something that you want to delete,
document.removeChild(element);
If you want to βcross outβ the base page, etc., you can use the iframe shim to achieve this.
Option 2
Another alternative is to use the JavaScript alert
function, but it's pretty intrusive and old-fashioned.
source share