<html>
<head>
<script>
function main(){
a = b;
}
window.addEventListener('load', function(){
try {
main()
} catch (e){
proceedException(e)
}
})
</script>
<script src="file.js">
</script>
</head>
<body>
<div id="error">
</div>
</body>
</html>
function parseStackTrace(stacktrace){
let [_, functionName, fileName, row, __, column] = stacktrace.match(/at\s([^\s]+)\s\((.+?):(\d+)(:(\d+))?\)/)
return [functionName, fileName, row, column]
}
function proceedException(exception){
let [fn, file, row, column] = parseStackTrace(exception.stack),
node = document.createElement('p');
node.innerText = `Ошибка в файле: ${file}, функция <${fn}> на строке ${row}${column ? '(' + column + ' символ)' : ''} ${exception}`;
document.querySelector('#error').appendChild(node);
}
function helper(){
let c = 1, a = b;
}
function onload(){
helper();
}
window.addEventListener('load', function(){
try {
onload()
} catch (e){
proceedException(e)
}
})
Mixed Content: The page at 'https://bundlespace.com/register-license?image=10005' was loaded over HTTPS, but requested an insecure resource 'httр://bundlespace.com/image/10005'. This request has been blocked; the content must be served over HTTPS.
<select id="part">
<option>
First
</option>
<option>
Second
</option>
<option>
Third
</option>
</select>
<button data-next=1 class='control'>Next</button>
<button class='control'>Previous</button>
const select=document.getElementById('part')
for (let btn of document.querySelectorAll('.control'))
btn.addEventListener( 'click', e => {
let i = select.selectedIndex + ( e.target.dataset.next ? 1 : -1),
l = select.options.length - 1
select.selectedIndex = i > l ? 0 : i < 0 ? l : i
})
const select=document.querySelector('#part')
for (let btn of document.querySelectorAll('.control'))
btn.addEventListener( 'click', e => {
let i = select.selectedIndex + ( e.target.dataset.next ? 1 : -1)
if (i in select.options) select.selectedIndex = i
})
$scope.ruLoanApproval = _ => $scope.loanApproval === 'DENIED' ? 'Отказано' : 'Одобрено'
$scope.loanApproval = response.data.approval === 'DENIED' ? 'Отказано' : 'Одобрено'
$("body").append("<button id='action1'>-</button>");
var talkf = function() {
var distance = function(n) {
var x = img.left - this.left;
var y = img.top - this.top;
return Math.sqrt((x * x) + (y * y));
};
if (distance() < 300) {
$("#action1").text("Начать диалог");
} else {
$("#action1").text("-");
};
};
var positionf = function() {
$("#" + this.id).offset({
left: this.left,
top: this.top
});
};
var img = {
id: "1",
left: 100,
top: 200,
position: setInterval(() => { positionf.bind(img)() }, 200),
};
var img2 = {
id: "2",
left: 500,
top: 600,
position: setInterval( () => { positionf.bind(img2)() }, 200),
talk: talkf.bind(img2)
};
function showResult(str) {
if (str.length==0) { document.getElementById("livesearch").innerHTML=""; return; }
if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest(); else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange=function() {if (xmlhttp.readyState==4 && xmlhttp.status==200) {document.getElementById("livesearch").innerHTML=xmlhttp.responseText;}}
xmlhttp.open("GET",encodeURI("livesearch.php?q="+str),true);
xmlhttp.send();
}
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/Bey4XXJAqS8?controls=1&showinfo=0&rel=0&loop=1&mute=0" frameborder="0" allowfullscreen></iframe>
let videoSource = "https://www.youtube.com/embed/Bey4XXJAqS8?controls=1&showinfo=0&rel=0&loop=1&mute=0";
if (hostType === 'PC') videoSource += '&autoplay=1';
$('iframe').eq(0).attr('src', videoSource);