You'd have to fake it using an overlay something like this. This solution won't operate the same way as the onclick="return... method, but it would work with some adaptation.
(you'll have to improve this yrself to make it useable I'm only tying this free hand here for the forum as a suggestion, so it's only pseudocode).
Def. replace the innerHTML and documentGetElement... with JQuery functions and accessors to make sure it's cross browser compatible, and check the syntax!!
CSS
<style>
.confbox
{
visibility:hidden;
width:300px;height:300px;
z-index:999;
position:absolute;
display:block;
top:30%;
left:30%;
}
</style>
HTML
<div id="myConfirmBoxName" class="confbox"><h3></h3><p></p><span></span></div>
<a href="#" önclick="myConfirmbox.open();">delete this article</a>
Javascript:
var confirmBox = function(_id)
{
this.id = _id;
this.title = 'My dialog';
this.text = 'Set this value to set the body text';
this.options = new Array();
this.domElement = document.getElementById(_id);
this.visible = false;
this.addOption = function(txt,val)
{
var o = [txt,val];
options.push(o);
}
this.setContent = function(title,body)
{
this.domElement.getElementsByTagName('h3')[0].innerHTML = title;
this.domElement.getElementsByTagName('p')[0].innerHTML = body;
this.domElement.getElementsByTagName('span')[0].innerHTML = '';/delete/article/321/
this.domElement.getElementsByTagName('h3')[0].innerHTML = title;
this.domElement.getElementsByTagName('p')[0].innerHTML = body;
this.domElement.getElementsByTagName('span')[0].innerHTML = '';
for (var i=2; i<options.length();i++;)
{
txt = options[i][0];
val = options[i][1];
link = '<a href="'+val+'" önclick="document.getElementById(\'+this.id+\'">'+txt+'</a>';
this.domElement.getElementsByTagName('span')[0].innerHTML += link;
}
}
this.open = function(destination)
{
this.setContent();
if (this.visible)
{
this.domElement.style.visibility = "visible";
} else {
this.domElement.style.visibility = "hidden";
}
visible = !visible;
}
}
}
var myConfirmBox = new confirmBox('myConfirmBoxName');
myConfirmbox.title = 'the title i want to use';
myConfirmbox.text = 'the text body I want to show';
myConfirmbox.addOption('Yes',"www.codeproject.com");
myConfirmbox.addOption('No',"www.facebook.com");
use javascript:yourfunction(); in the addOption val to call a function instead of running a link. if you want 'true/false' to be return to the calling function you cuold add a callback handler to the confirmBox pseudo-class, or re-write the setContent() function to handle the way the links are created in a different way...