$(function(){
$("#open").click(function(){
$("#portfolio").toggleClass('active')
$("#open").hide();
});
});
try{
$.ajax({
url: 'test.php',
type: "POST",
data: {
HCID
},
success: data => {
// КОД В СЛУЧАЕ SUCCESS
},
error: result => {
// КОД В СЛУЧАЕ ERROR
}
});
}
catch(err){
console.log(err);
}
const mongo = require('mongodb').MongoClient
const url = 'mongodb://localhost:27017';
mongo.connect(url, { useNewUrlParser: true }, async (err, client) => {
if (err) {
console.log('Connection error: ', err)
throw err
}
console.log('Connected')
const db = client.db('pageLinks');
const allLinks = db.collection('allLinks');
await allLinks.find({subcategory: 'subcategory2'}).toArray(function(err, results){
console.log(results);
});
client.close();
})