My friend has an online webpage, which it has an inline script tag, there is a JavaScript function:
(#1):
var domain = window.location.protocol + "//" + window.location.host + '/';
$(document).ready(function() {
var count = 5;
countdown = setInterval(function() {
if (count == 0) {
$('#countdow').hide();
$('#link-news').show()
} else {
$('#countdow').text(count);
count--
}
}, 1700);
$('#link-news').click(function() {
var urls = $('input[name=linknexttop]').val();
if (urls == 1) {
$('input[name=linknexttop]').val(2);
$.ajax({
type: "GET",
url: domain + "click.html",
data: "code=Sh9QA&token=0982ff3066a3c60dbd3ecf9bcafc801b",
contentType: "application/json; charset=utf-8",
success: function(html) {
//alert(html);
window.location = html;
}
})
}
})
});
He has given a puzzle: "Can I run the below code without modified his original code?".
(#2):
$('input[name=linknexttop]').val(2);
$.ajax({
type: "GET",
url: domain + "click.html",
data: "code=Sh9QA&token=0982ff3066a3c60dbd3ecf9bcafc801b",
contentType: "application/json; charset=utf-8",
success: function(html) {
//alert(html);
window.location = html;
}
Rule for playing: "I am allowed to insert my code bellow his original code only; so, I am not allowed to change anything in his code. And, the most important, code=Sh9QA&token=0982ff3066a3c60dbd3ecf9bcafc801b
is random.".
To save the time for waiting, I have used this extension to prevent the working of countdown();
; and, add this code into it:
(#3):
$('#countdow').hide();
$('#link-news').show();
Next , I tried to go to pass the urls = $('input[name=linknexttop]').val();
. I tried with urls == 1;
; but, I failed.
My question is: "Is there any way to pass the urls = $('input[name=linknexttop]').val();
, with all rules of this game are accepted?". If it is possible, please let me know.