$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => 'http://target.site.com/form.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query(array(/*здесь массив параметров запроса*/))
));
$response = curl_exec($myCurl);
curl_close($myCurl);
echo "Ответ на Ваш запрос: ".$response;
$.ajax('https://opskins.com/ajax/browse_scroll.php?page=1&appId=730&contextId=2', {
headers: {
"Host": "opskins.com",
"Connection": "keep-alive",
"Accept": "*/*",
"X-Requested-With": "XMLHttpRequest",
"X-OP-UserID": "28044339",
"X-CSRF": "2ADuEWQS6oFljN3veQFbe47lBBYvaI62X",
"User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
"Referer": "https://opskins.com/?loc=shop_browse",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
"Cookie": "blabla=bloblo; blablabl2=bloblo4; aaa=bbb"
}, // ВОТ ОНА ОШИБКА (НУЖНА ЗАПЯТАЯ)
crossDomain: true,
success: function (body) {
console.log(body);
},
error: function (error) {
console.log(error);
}
});
$.ajax({
url: 'foo/bar',
headers: { 'x-my-custom-header': 'some value' }
});
body: `Hey, ${userName}! You've been notified!`,
body: "Hey, " + userName + "! You've been notified!",
var ar1 = ['white', 'red', 'black', 'orange'];
var ar2 = ['white', 'black'];
var res = [];
var res2 = [];
for (var i = 0; i < ar1.length; i++) {
if ( ar2.indexOf(ar1[i]) !== -1 ) {
res[res.length] = ar1[i];
}
}
// или
for (var i = 0; i < ar1.length; i++) {
for (var j = 0; j < ar2.length; j++) {
if (ar1[i] == ar2[j]) {
res2[res2.length] = ar1[i];
}
}
}
alert(res);
alert(res2);
let arr1 = ["Alex", "Nick", "John", "Sasha", "Bill", "Donald", "Pit"];
let arr2 = ["Nick", "Bill", "Alex", "Masha", "Pasha", "Pit"];
let obj = {};
for (let i = 0; i < arr1.length; i += 1) {
for (let j = 0; j < arr2.length; j += 1) {
if (arr1[i] === arr2[j]) {
obj[arr1[i]] = true;
}
}
}
// Или так
// for (let i = 0; i < arr1.length; i += 1) {
// if (arr2.includes(arr1[i])) {
// obj[arr1[i]] = true;
// }
// }
console.log(Object.keys(obj)); // ["Alex", "Nick", "Bill", "Pit"]
function lalka() {
var stickerArray = Array.from( document.querySelectorAll('.sticker') );
if ( stickerArray.length ) {
var words = ['Wear', 'Unscratched'];
stickerArray.forEach( function (sticker) {
var stickerTitle = sticker.getAttribute('title');
words.map(function(word) {
if(word === stickerTitle) {
}
});
var arr = sticker.title.split('\n').filter(str=>{return str.length > 0})
var n = arr.find(e => -1 != e.split('').indexOf('e'))
console.log(n);
});
}
}
setInterval(lalka, 5000);
$0
в консоли ссылается на тот элемент, который выбран в данный момент в инспекторе. И это не обязательно строка, а любой DOM-элемент.