<script> $(document).ready(function () { $('#btnLogin').click(function () { $.ajax({ url: 'testurl', type: 'Get', beforeSend: function (xhr) { xhr.setRequestHeader("Authorization", "Basic " + btoa("username" + ":" + "Password")); }, success: function (response) { console.log(response) $('#imga').html('<img src="data:image/gif;base64,' + response + '" />'); }, error: function (error) { alert("error") console.log(error) } }); }); }); </script>
<input type="button" id="btnLogin" value="Login" /> <div id="imga"></div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)