JSONP and 401 response
===

Hello trying to use JSONP on my web page and generate the code below using javascript:

 

    <script src="https://{{ username }}:{{ password }}@www.link.com/api/2/project/link/resource/core/stats/?callback=updateStats&amp;random=1343727774180" id="jsonp"></script>

which is generated using the code below


    function handleRefresh(url) {
    	console.log("here");
    
    	var newScriptElement = document.createElement("script");
    	newScriptElement.setAttribute("src", url);
    	newScriptElement.setAttribute("id", "jsonp");
    	var oldScriptElement = document.getElementById("jsonp");
    	var head = document.getElementsByTagName("head")[0];
    	if (oldScriptElement == null) {
    		head.appendChild(newScriptElement);
    	}
    	else {
    		head.replaceChild(newScriptElement, oldScriptElement);
    	}
    }


the problem is that if i don't login before i get an unauthorized  response (401), so how can i read the response i get?