var $button = $('button');
$('body').on('submit', 'form', function(e) {
e.preventDefault();
$button.addClass('is-busy');
var formData = !!window.FormData ? new FormData($(this)[0]) : $(this).serialize();
$.ajax({
url: '/request/url',
type: 'POST',
data: formData,
dataType: 'JSON',
contentType: false,
processData: false,
success: function(response) {
$button.removeClass('is-busy');
},
error: function(response) {
$button.removeClass('is-busy');
}
});
});
<svg role="image">
<use xlink:href="/put/k/failu/file.svg#back"/>
</svg>
svg { color: currentColor; }
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<defs>
<symbol id="icon"><path d="M0 .5L.5 0 7 6.5 13.5 0l.5.5L7.5 7l6.5 6.5-.5.5-3-3L7 7.5.5 14l-.5-.5L6.5 7 0 .5z" fill-rule="evenodd"/></symbol>
</defs>
</svg>
<div class="label" style="color: red">
<svg role="image">
<use xlink:href="#icon"/>
</svg>
</div>