[
{
"idn" : "liquido",
"categoria": "Aromatizante Ambiental Liquido",
"productos": [
{
"nombre": "Canela"
},
{
"nombre": "Chanel"
},
{
"nombre": "Citrus"
},
{
"nombre": "Coco"
},
{
"nombre": "Floral"
},
{
"nombre": "Manzanas"
},
{
"nombre": "Spa Relax"
},
{
"nombre": "Vainilla"
}
]
},
{
"idn" : "aerosol",
"categoria": "Aromatizante Ambiental en Aerosol",
"productos": [
{
"nombre": "Good Sense Jardin de Tuscan Neutralizador de Olores Aerosol"
},
{
"nombre": "Good Sense Potpourri Neutralizador de Olores Aerosol"
},
{
"nombre": "Good Sense No Smoke Eliminador de Olores Aerosol"
}
]
}
]
I have this code, from a json file, i make a function, to make tabs, for each "categoria", but when i try a make "click" to the "li" element, doesn't work, it's like not make a click, but the html is generating correctly.
Even if add a "a" element,this not work. But
Any one, knows why?. Thanks
You did not show your client-side code. It is a problem with client-side code. Also you did not even said which language you use. Please provide more information. Please check json.org before you ask a question. Good Luck :)
Related
thank you in advance for reading me. So I have been working in a filte. Right now my filter works, however doesn't do what I want. The current status is. When I select 2 options or more. I get all the values inside the data that contains either optionA oder optionB.
See my example data below:
{
"_uid": "1",
"body": [
{
"_uid": "2",
"name": "John",
"image": {
"id": 6807178,
"filename": "https://",
"copyright": "",
"fieldtype": "asset",
"is_external_url": false
},
"gewerk": "Project Owner",
"skill": ["vuejs", "react", "symfony"],
"component": "person",
},
{
"_uid": "3",
"name": "Jean",
"image": {
"id": 6807182,
"filename": "https://",
"copyright": "",
"fieldtype": "asset",
"is_external_url": false
},
"gewerk": "UI",
"skill": ["svelte"],
"component": "person",
},
{
"_uid": "4",
"name": "Martha",
"gewerk": "Frontend",
"skill": ["vuejs", "react"],
"component": "person",
},
{
"_uid": "5",
"name": "Tom",
"gewerk": "UI",
"skill": ["svelte", "angular", "vuejs"],
"component": "person",
}
],
}
With that being says when I filter using this example combi(screenshot). I get Martha, Tom and John as a result. When what I actually want is to have only Tom as a result. because only Tom have both criterias together inside his skills data.
This is my current computed function:
filterPersonSkill() {
return this.getComponentPerson.filter((e) =>
e.skill.map((skill) => this.multiValue.includes(skill)).includes(true)
);
}
At the beginning I used includes instead of map and that worked half. Because I was getting the result only if I selected in the same order(in the multiselect) as the array skills was appearing. Example below
filterPersonSkill() {
return this.getComponentPerson.filter((e) =>
e.skill.includes(...this.multiValue)
);
}
Thank in advance for the advice and reading me.
I think, it will be much simpler, if you add checkbox for the user to use "exact" filtering, i.e. results which include only selected tags.
With such a checkbox you can do something like this:
// your vue component
export default {
data() {
return {
exactMatch: true,
}
},
methods: {
filterPersonSkillExactMatch() {
const result = [];
for (const p of this.getComponentPerson) {
if (p.skill.length === this.multiValue.length
&& this.multiValue.every(val => p.skill.includes(val))) {
result.push(p)
}
}
return result
}
// somewhere in your code (either computed prop or method):
filteredPersons() {
if (exactMatch) {
return this.filterPersonSkillExactMatch()
}
return this.filterPerson()
}
}
}
I am having troubles in adding images to my adventure game.
I am doing this for school. I got the information down, but I am stuck in trying to add specific images so they can show up once I press the button to progress the story.
Sorry if how I describe my problem comes across confusing...
The code shows up fine. All I want to do is add some images to my game.
Here's a link to the code, and here's the script within the HTML. I am not sure if I am doing it right.
EDIT:: (UPDATED LINK TO JSFIDDLE)
fiddle
var db = [
{
"question": "<br><b> From where he stands, there is a door way. To the left, there is a mirror.</b>",
"answers": [{
"title": "Go through the doorway.",
"response": 1
},
{
"title": "Look into the mirror.",
"response": 2
}
]
}, {
"question": "<b> As he was approaching the doorway, he asked himself: <i> Why Would I want to do that?</i></b>",
"answers": [
{
"title": "Go back.",
"response": 0
}
]
},
{
"question": "<b>The man looks at himself and sees that he appear to be a blue-haired man. For some reason, the man feels unsettled with the reflection that's being projected.</b>",
"answers": [{
"title": "Check pockets",
"response": 3
}]
},
{
"question": "<b>In his pockets there's a wallet, small notebook and a watch. The Watch isn't working, so he puts the watch away. Both of the objects has the name <i> Dimitri Zimmerman </i> written on them. The man now remembers his name.</b>",
"answers": [{
"title": "Check wallet.",
"response": 4
},
{
"title": "Check the note-book.",
"response": 6
}
]
},
{
"question": "<b> Dimitri opened the wallet and quickly figured out as to why he felt this disembodied feeling when faced with the refection. Dimitri's appearance changed entirely. The ID photo presents a more mundane appearance than the demonic appearance that now presents him. Dimitri also finds out he's a Detective by examining his ID.</b>",
"answers": [{
"title": "Check the note-book.",
"response": 5
} ]
},
{
"question": "<b> While putting the wallet back in his pocket, Dimitri began flipping through the pages.</b>",
"answers": [
{
"title": "...How odd",
"response": 6
}
]
},
{
"question": "<b>There appears to be some sort of writing within the pages that Dimitri can't comprehend. Briskly he raffled through the pages to find anything legible.</b>",
"answers": [{
"title": "Keep Looking",
"response": 7
}]
},
{
"question": "<b> Dimitri continue to flip through the illegable pages. On the last page you are able read what's written.</b>",
"answers": [
{
"title": "Read.",
"response": 8
}]
},
{
"question": "<b> Crudely written in red-ink, it read:<br> <i> I have gone beyond than any mortal should, I might lose my mind or something once making contact with the Black Lodge... Remember I am looking for ----- R---. I must not forget why I am here, so I have this notebook to remember if I were to become lost. I must apprehend that murder.</i> Where the name should be displayed, it's the same incoherent scribbles on the pages before.</b>",
"answers": [
{
"title": "Put the note-book away.",
"response": 9
}]
},
{
"question": " <b> After putting the notebook away, Dimitri stepped away from the mirror and looked over to the doorway, still hazed with the details of why he is here. All that Dimitri knows that he's a Detective who's after a murder.</b>",
"answers": [
{
"title": "Leave the room.",
"response": 10
}]
},
{
"question": "<b>To be Continued...</b>",
}];
If you want to add different image for different question, you can modify the json as below.
Can add the individual image path to each json, or can ignore if no need of image for any question.
if(db[currentLocation].img){
document.getElementById("img").src = db[currentLocation].img
}else{
document.getElementById("img").src = ''
}
overall code
function pictureChange() {
document.getElementById("theImage").src = "http://31.media.tumblr.com/fca646cd8fe87906e605ad7e8d039903/tumblr_mmoz4fWT6U1soh1p8o1_500.png";
}
var db = [
{
"question": "<br><b> From where he stands, there is a door way. To the left, there is a mirror.</b>",
"answers": [{
"title": "Go through the doorway.",
"response": 1
},
{
"title": "Look into the mirror.",
"response": 2
},
]
}, {
"question": "<b> As he was approaching the doorway, he asked himself: <i> Why Would I want to do that?</i></b>",
"img": "http://31.media.tumblr.com/fca646cd8fe87906e605ad7e8d039903/tumblr_mmoz4fWT6U1soh1p8o1_500.png",
"answers": [
{
"title": "Go back.",
"response": 0
},
]
},
{
"question": "<b>The man looks at himself and sees that he appear to be a blue-haired man. For some reason the man feels unsettled with the reflection that's being projected.</b>",
"img": "http://31.media.tumblr.com/fca646cd8fe87906e605ad7e8d039903/tumblr_mmoz4fWT6U1soh1p8o1_500.png",
"answers": [{
"title": "Check pockets",
"response": 3
}]
},
{
"question": "<b>In his pockets there's a wallet, small note-book and a watch. The Watch isn't working, so he puts the watch away. Both of the objects has the name <i> Dimitri Zimmerman </i> written on them. The man now remembers his name.</b>",
"answers": [{
"title": "Check wallet.",
"response": 4
},
{
"title": "Check the note-book.",
"response": 6
},
]
},
{
"question": "<b> Dimitri opened the wallet and quickly figured out as to why he felt this disembodied feeling when faced with the refection. Dimitri's appearance changed entirely. The ID photo presents a more mundane appearance than the demonic appearance that now presents him. Dimitri also finds out he's a Detective by examining his ID.</b>",
"answers": [{
"title": "Check the note-book.",
"response": 5
},]
},
{
"question": "<b> While putting the wallet back in his pocket, Dimitri began flipping through the pages.</b>",
"answers": [
{
"title": "...How odd",
"response": 6
},
]
},
{
"question": "<b>There appears to be some sort of writing with in the pages that Dimitri can't comprehend. Briskly he raffled through the pages to find anything legable.</b>",
"answers": [{
"title": "Keep Looking",
"response": 7
},]
},
{
"question": "<b> Dimitri continue to flip through the illegable pages. On the last page you are able read what's written.</b>",
"answers": [
{
"title": "Read.",
"response": 8
},
]
},
{
"question": "<b> Crudely written in red-ink, it read:<br> <i> I have gone beyond than any mortal should, I might lose my mind or something once making contact with the Black Lodge... Remember I am looking for ----- R---. I must not forget why I am here, so I have this note-book to remember if I were to become lost. I must apprehend that murder.</i> Where the name should be displayed, it's the same incohearent scribbles on the pages before.</b>",
"answers": [
{
"title": "Put the note-book away.",
"response": 9
},
]
},
{
"question": " <b> After putting the note book away, Dimitri stepped away from the mirror and looked over to the doorway, still hazed with the details of why he is here. All that Dimitri knows that he's a Detective who's after a murder.</b>",
"img": "http://31.media.tumblr.com/fca646cd8fe87906e605ad7e8d039903/tumblr_mmoz4fWT6U1soh1p8o1_500.png",
"answers": [
{
"title": "Leave the room.",
"response": 10
},
]
},
{
"question": "<b>To be Continued...</b>",
},
];
var currentLocation = 0;
window.printCurrentLocation = function () {
document.getElementById("question").innerHTML = db[currentLocation].question;
debugger;
if (db[currentLocation].img) {
document.getElementById("img").src = db[currentLocation].img
} else {
document.getElementById("img").src = ''
}
var answers = "";
for (var i = 0, l = db[currentLocation].answers.length; i < l; i++) {
answers += "<p><button onclick='setLocation(" + db[currentLocation].answers[i].response + ")'>" + db[currentLocation].answers[i].title + "</button></p>";
}
document.getElementById("answers").innerHTML = answers;
}
window.setLocation = function (num) {
currentLocation = num;
window.printCurrentLocation();
}
window.printCurrentLocation();
I'm not able deploy alexa skill using alexa-cli tool (https://www.npmjs.com/package/ask-cli) when I try to deploy my skill with a https server
As an error I get:
◞ Creating new skill...Call create-skill error.
Error code: 400
{
"message": "Skill manifest is not valid.",
"violations": [
{
"message": "No default regionalized endpoint is defined."
}
]
}
Im using an example skill.json from:
https://github.com/alexa/skill-sample-nodejs-hello-world/blob/master/skill.json
A problem is how to add custom uri endpoint. I dont want to host my skill in AWS lambda function.
I tried to follow documentation:
https://developer.amazon.com/de/docs/smapi/ask-cli-command-reference.html
but I dont know what Im doing wrong...
Could sombody please take a look at my json and alexa-cli documentation? Why Im getting a such weird message?
"No default regionalized endpoint is defined."
?
{
"manifest": {
"publishingInformation": {
"locales": {
"en-US": {
"summary": "Sample Short Description",
"examplePhrases": [
"Alexa open hello world",
"Alexa tell hello world my name is bill",
"Alexa tell hello world I want to play"
],
"name": "trivia",
"description": "Sample Full Description"
}
},
"isAvailableWorldwide": true,
"testingInstructions": "Sample Testing Instructions.",
"category": "KNOWLEDGE_AND_TRIVIA",
"distributionCountries": []
},
"apis": {
"custom": {
"endpoint": {
"sourceDir": "./lambda/custom",
"uri": "https://customapi.sampleskill.com",
" sslCertificateType": "Wildcard"
},
"regions": {
"EU": {
"endpoint": {
"uri": "https://customapi.sampleskill.com",
"sslCertificateType": "Trusted"
}
}
}
}
},
"manifestVersion": "1.0"
}
}
Ok for those who faced that problem in the future ;) Important is that in your skill root directory you have that file:
.ask/config
It should look like:
{
"deploy_settings": {
"default": {
"skill_id": "put here your skill id or leave it blank",
"was_cloned": false,
"merge": {
"manifest": {
"apis": {
"custom": {
"endpoint": {
"uri": "https://yourhttps.de",
"sslCertificateType": "Wildcard"
}
}
}
}
}
}
}
}
after that you can use ask-cli with the https server as an endpoint :)
Try this:
"apis": {
"custom": {
"endpoint": {
"uri": "https://customapi.sampleskill.com",
"sslCertificateType": "Wildcard"
},
"regions": {
"EU": {
"endpoint": {
"uri": "https://customapi.sampleskill.com",
"sslCertificateType": "Trusted"
}
}
}
}
}
In the default config you had set sourceDir which doesn't make much sense for endpoints outside AWS Lambda. Second your config contained whitespace around sslCertificateType, which also might cause the problem.
I'm working on a tree layout like this one: http://www.robschmuecker.com/d3-js-drag-and-drop-zoomable-tree/ that is based off mbostock's original design (http://mbostock.github.io/d3/talk/20111018/tree.html).
I'm having 3 issues with it. I'd like to be able to extend the branches both left and right of the root - in other words I'd like to be able to mirror what the sample looks like.
The second issue I'm having is that the flare.json file for this format needs to be in a very specific format - it needs to look exactly like this
{
"children": [
{
"children": [
{},
{}
]
}
]
}
While mine looks approximately like
"head": {
"title": "titleHere",
"ownerName": "nameHere
},
"body": {
"outline": [
{
"outline": [
{
"_text": "A"
},
{
"_text": "B"
},
{
"_text": "C"
},
{
"_text": "D"
},
{
"_text": "E"
}
],
"_text": "Category Header"
},
{
},
}
I basically need to write an algorithm that re-formats what I have into the correct format so I can feed it into my tree layout, if that makes sense.
The final issue I'd like to work on is to be able to edit the text by double-clicking on the tree chart.
I'm trying to build a custom Facebook page feed into my website. When the posts on the Facebook page have only images it works great, but when they have videos we've got a problem. What I would like to happen is a mini version of the video to be place as it was an image itself. However I'm a newbie to the graph api, because of that I don't know how to grab the "source" element of the posts that have video on them.
Here is how the JSON objetc looks like:
{
"name": "Patrick Oliveira",
"picture": {
"data": {
"is_silhouette": false,
"url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xft1/v/t1.0-1/c13.0.50.50/p50x50/11694800_709940652467661_5760283552162746065_n.jpg?oh=8ce289debf38df76b1a8ad72e9e32950&oe=5641D882&__gda__=1447414822_01484acd6dcdb29c62a7278a140bb592"
}
},
"posts": {
"data": [
{
"full_picture": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xft1/v/t1.0-9/p417x417/11873451_734632043331855_4522184841179328970_n.jpg?oh=67bd84af22a94bc59a2996ff8fa0a8d8&oe=563F7BE8&__gda__=1447502842_a29144ab596e29d3d92d2239d376adc9",
"message": "Lan\u00e7ado em fevereiro de 1990, o Photoshop completa 25 anos como o programa de edi\u00e7\u00e3o de imagens mais famoso do mundo. Parab\u00e9ns Adobe!",
"created_time": "2015-08-14T20:52:08+0000",
"id": "213578595437205_734632043331855"
},
{
"full_picture": "https://scontent.xx.fbcdn.net/hphotos-xft1/v/t1.0-9/q81/s720x720/11415380_700706213391105_871834721491614634_n.jpg?oh=8672f7ae4931323baaf012e5f57a6079&oe=567F5D35",
"message": "\"Agora eu sei de que \u00e9 feito aquele ch\u00e3o\".\n-- cliente",
"created_time": "2015-07-04T20:05:01+0000",
"id": "213578595437205_700706213391105"
},
{
"full_picture": "https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-xpt1/v/t1.0-9/s720x720/11406889_700700410058352_5592320885219405365_n.jpg?oh=acedee420f8e4944201c714e30f70627&oe=5679534C&__gda__=1451225194_477268223eedc2217b2ae1dcdd345399",
"message": "Levante que hoje \u00e9 Sexta!",
"created_time": "2015-07-03T09:27:01+0000",
"id": "213578595437205_700700410058352"
},
{
"full_picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBxQzu6zRD6fM_d&w=720&h=720&url=http\u00253A\u00252F\u00252Fi.ytimg.com\u00252Fvi\u00252F2K9eMZyD5jc\u00252Fmaxresdefault.jpg&cfs=1",
"message": "Ferramenta poderosa pra quem trabalha com fotos de arquitetura, o Adaptive Wide Angle pode ser um poderoso aliado!\nhttps://www.youtube.com/watch?v=2K9eMZyD5jc",
"created_time": "2015-07-02T18:25:01+0000",
"source": "http://www.youtube.com/v/2K9eMZyD5jc?version=3&autohide=1&autoplay=1",
"id": "213578595437205_700700186725041"
},
{
"full_picture": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xft1/v/t1.0-9/s720x720/541646_700699430058450_5858057325981612930_n.jpg?oh=24a5d3e03cf1f782262e0b72d04831b4&oe=567999FA&__gda__=1451117341_93c352ddfa2804fa4047d84ab94978d9",
"message": "Come\u00e7ando o m\u00eas de Julho com o p\u00e9...",
"created_time": "2015-07-01T10:23:00+0000",
"id": "213578595437205_700699430058450"
}
],
"paging": {
"previous": "https://graph.facebook.com/v2.4/213578595437205/posts?limit=5&fields=full_picture,message,created_time,source&since=1439585528&access_token=1641569939420394|NyfBDunYwpFoZrtAoCSfqTV2-uU&__paging_token=enc_AdDQS8eEeKGQ3tvUJJxS1kyUXRwabHz2C1GZA0QZCufpZCHklYUI76WLCrigOB3IT1yxUtsCvx60ZA2haPnZA2Xoc2BOvPOLkM9eZBrbbrV1A87hVgIgZDZD&__previous=1",
"next": "https://graph.facebook.com/v2.4/213578595437205/posts?limit=5&fields=full_picture,message,created_time,source&access_token=1641569939420394|NyfBDunYwpFoZrtAoCSfqTV2-uU&until=1435746180&__paging_token=enc_AdAVBcOniyc1nbopw3Gr3CkmZB1pUDYBmZBghDmQXLunZBbvcuO1xttx6vpnkZBskAawu1sdcfh6qZCrU3sZA5MzZAkRQMT2VALYxOkCJOQZCm38ebDd2wZDZD"
}
},
"id": "213578595437205"
}
The fourth post is a video post, so I thought maybe I could generate a smaller video feed if I could grab that video source there.
Here is what I've been trying to do:
$.getJSON("https://graph.facebook.com/"+$page_id+"/?fields=name,picture,posts{full_picture,message,created_time}&access_token="+$access_token, function(fb) {
fb.posts.data[3].source;
});
However, the only thing I get from that is "undefined". If I do fb.posts.data[3].message or fb.posts.data[3].created_time or any of the other options it works, just for source that it returns "undefined". What am I doing wrong?
I found out what was wrong, so stupid. The request URL was missing the source element. So with this it works:
$.getJSON("https://graph.facebook.com/"+$page_id+"/?fields=name,picture,posts{full_picture,message,created_time,source}&access_token="+$access_token, function(fb) {
fb.posts.data[3].source;
});
I'm sorry for the mistake, it was my bad.