$(document).ready(function(){
function showxxx()
{
$.ajax({
url: "rand_banner_header.php",
cache: false,
success: function(html){
$("#contentqxxxxxxx").html(html);
});
setTimeout(showxxx, 30000);
};
setTimeout(showxxx, 30000);
});
$(document).ready(function(){
function showxxx()
{
$.ajax({
url: "rand_banner_header.php",
cache: false,
success: function(html){
$("#contentqxxxxxxx").html(html);
});
setTimeout(showxxx, 30000);
};
setTimeout(showxxx, 30000);
});
url instanceof String && url.length ? url : '/'; // Изучите
getData() // По стандарту стоит '/' не нужно вводить url
async function getData(url) {
url instanceof String && url.length ? url : '/';
const options = {
method: 'POST',
headers: {
'Content-Type' : 'application/json'
}
};
let response = await fetch(url, options);
let data = response.json();
return data;
}
const data = getData(); // Ваши данные
console.log(data);
var mysql = require('mysql');
console.log('Get connection ...');
var conn = mysql.createConnection({
database: 'university',
host: "localhost",
user: "aaa",
password: "aaa"
});
conn.connect();
app.post('/', (req, res) => {
conn.query("SELECT `fio` FROM `students` WHERE `id`=1",function(error,result){
if (error) throw error;
res.send(result.map(item => item));
});
});
> node test.js