Reputation: 313
I'm trying to use a variable (or to find another way) to use a variable into my href.
Can anybody help with that?
app.on('changeup:myNewTender', function(data){
var urrl = "/#manage/"+data._id;
$.pnotify({
type: 'success',
delay: 3000,
text: '<a href=urrl>Your tender has been published</a>'
});
}
Upvotes: 0
Views: 97
Reputation: 43842
You should use string concatenation using +
. You should also surround the URL with quotes of some kind, since good practice states that HTML attributes should be quoted.
'<a href="' + urrl + '">Your tender has been published</a>'
Upvotes: 1
Reputation: 104775
String concatenation:
'<a href=' + urrl + '>Your tender has been published</a>'
Upvotes: 4