Adding image to html markup
Posted
by
user1491991
on Stack Overflow
See other posts from Stack Overflow
or by user1491991
Published on 2012-06-30T03:14:02Z
Indexed on
2012/06/30
3:15 UTC
Read the original article
Hit count: 104
Hello guys i'm having a problem appending a image to my html markup which is generated when a button is clicked... wondering if i could some dirction
__--------------------------SCRIPT-----------------------------------------------------------
(function($){
$.confirm = function(params){
if($('#confirmOverlay').length){
// A confirm is already shown on the page:
return false;
}
var buttonHTML = '';
$.each(params.buttons,function(name,obj){
// Generating the markup for the buttons:
buttonHTML += '<a href="#" class="button '+obj['class']+'">'+name+'<span></span></a>';
if(!obj.action){
obj.action = function(){};
}
});
var closetext= 'close';
var markup = [
'<div id="confirmOverlay">',
'<div id ="model">','<div id="confirmBox">',
'<div id="header">','<div id ="title">',params.title,'</div>',
'<div id="close">','<ol id = "olclose">','<li id = "liclose">','<a id="close" href = "#">',closetext,'</a></li>',
'<li id = "liclose">','<a id="close" href = "#">','<img src="../modal-close.gif"/>','</a></li>','</ol></div></div>',
'<div id ="textbox">','<p>',params.message,'<br>','<br>'
,buttonHTML,'</p>',
'</div>',
'</div></div></div></div>'
].join('');
$(markup).hide().appendTo('body').fadeIn();
var buttons = $('#confirmBox .button'),
i = 0;
$.each(params.buttons,function(name,obj){
buttons.eq(i++).click(function(){
// Calling the action attribute when a
// click occurs, and hiding the confirm.
obj.action();
$.confirm.hide();
return false;
});
});
}
$.confirm.hide = function(){
$('#confirmOverlay').fadeOut(function(){
$(this).remove();
});
}
})(jQuery);
i've used firebug to check and its unable to fetch the image here
© Stack Overflow or respective owner