我正在尝试创建类似于定义为对话框的内容,该对话框会在单击按钮时出现,并且应该显示标题、随机图像和按钮以进一步处理原始请求。
function custom_display_reminder(theHTML,theDownloadLink){if(typeof jQuery.ui!='undefined'){$("#dialog").attr("title","Please help spread the word").html(theHTML);$("#dialog").dialog({modal:true,width:375,buttons:{"Continue to Download":function(){$(this).dialog("close");window.location=theDownloadLink;}}});}else{window.location=theDownloadLink;}}
function custom_reminder(aelem,topic){theLink=$(aelem).attr("href");
$.ajax({
type:"POST",
url:"/db/ajax.php",
data:"action=reminder&thepath="+theLink+"&topic="+topic,
dataType:"json",
error:function(){window.location=theLink;},
success:function(msg){if(msg.status==1)custom_display_reminder(msg.html,theLink);
else{custom_message(msg.message,"error");}}});}
我在其中一个网站上找到了上面的脚本,该网站具有我正在尝试实现的特定功能,但无法理解该过程。有人可以帮我解释该脚本的过程和所有调用吗?
提前致谢