How can I retrive parameter “url” inside call back function?
Function declared in global scope:
var showPrompt = function(text, callBackFunc){
$('#msg').html(text);
$('#msgbtn').click( function(){callBackFunc();})
};
//calling function
$('li').click(function(){ // about 100 li el.
var url = '/prod/' + $(this).data('id');
showPrompt('Page will be redirected', function(url){
window.location = url;
})
})
Use this way (cleaner approach)
‘- OR –