nmp i
npm start
if($.cookie('ab_form')) alert(11);
<script src="/js/jquery.cookie.js"></script>
<script>
rand = Math.floor((Math.random() * 2) + 1);
if(rand==1) {
$.cookie('ab_form', true);
} else {
$.cookie('ab_form', false);
}
if($.cookie('ab_form')) alert(11);
</script>
server.register( SwaggerPlugin, {
routePrefix: '/doc',
exposeRoute: true,
swagger: {
info: {
title: 'Fastify API',
description: 'Building a blazing fast REST API with Node.js, MongoDB, Fastify and Swagger',
version: '1.0.0'
},
externalDocs: {
url: 'https://swagger.io',
description: 'Find more info here'
},
host: 'localhost:3000',
schemes: ['http'],
consumes: ['application/json'],
produces: ['application/json']
}
})
$prejson = str_replace('\'', '"', $row['material_data']);
$json = json_decode($prejson, true);
var_dump($json['description']);
3. Как общаться из background.js в popup.js
"permissions": [
"storage"
]
function getUpdates()
{
$.ajax({
url: server + '/api/updates',
success: function(data){
setStorage('updates', data);
}
});
}
function setStorage(key, value)
{
chrome.storage.local.set({[key]: value}, function() {
console.log('Value is set to ' + value);
});
}
function getStorage(key) {
var ar = [];
var data = '';
ar.push(key);
return new Promise(function(resolve, reject) {
chrome.storage.local.get(key, function(obj) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
reject(chrome.runtime.lastError.message);
} else {
resolve(obj[ar[0]]);
}
});
});
}
getStorage('updates').then(function(item) {
console.log(item);
});;
<style type="text/css">
.warp {
display: flex;
}
</style>
<form method="POST" action="index.php">
<div class="warp">
<div>Цена</div>
<div><input type="text"></div>
<div>комиссия</div>
</div>
<div class="warp">
<div>Яндекс деньги</div>
<div><input type="text"></div>
<div></div>
</div>
<div class="warp">
<div>телефон</div>
<div><input type="text"></div>
<div></div>
</div>
<div class="warp">
<div>телефон</div>
<div><textarea></textarea></div>
</div>
<div class="warp">
<div>капча</div>
<div><input type="text"></div>
<div><img></div>
</div>
<div class="warp">
<div>текст текст тексттекст текст тексттекст текст тексттекст текст тексттекст текст текст</div>