Не будет ли это нарушением?
$sth = $dbpdo->prepare("INSERT INTO `blogs` SET `text` = ?");
$post_text = addslashes($_POST['post_text']);
if(strlen($post_text) > 15) {
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri; # enforce https
# rewrite ^(.*) https://www.example.com$uri permanent;
}
HTMLElement.prototype.waitFor = function(event_name) {
if (event_name) {
return new Promise((res, rej) => {
const listener = function() {
res()
this.removeEventListener(event_name, listener)
};
this.addEventListener(event_name, listener);
})
} else {
throw 'No event passed to waitFor method!';
}
}
async function foo() {
const start = new Date();
await document.querySelector('body').waitFor('click');
console.log('uspeshno dojdalis clicka, jdali celih ' + ((new Date().getTime() - start.getTime())/1000) + ' sekund');
}
foo();
$.get( "file.txt", function( data ) {
window.fileTxtContent = data;
});
и теперь уже станет «можно» и глобально с ним работать. Но на этот момент весь «обычный» код уже давно отработал.function workWithFileTxt(content) {
console.log("Я свободен от jQuery! А вот текст из файла: ", content);
}
$.get( "file.txt", workWithFileTxt);