How can I use sprintf in jQuery?
I'm trying to add an id
to a chunk of HTML that is returned from a script
So:
success: function(html){
$('.data').html($.sprintf(html,'TEST'));
},
The HTML that is returned is a large chunk of HTML where i've added a %s
for sprintf to do it's replacement.
Eg: '<div>Welcome to Blah</div><div>You userId is %s</div>'