Click here to Skip to main content
15,564,470 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: why javascript onchange not triggered for persian characters ? Pin
Jeremy Falcon26-Oct-22 12:10
professionalJeremy Falcon26-Oct-22 12:10 
QuestionDodger game with eventListener Pin
Ali Ibrahim jasim16-Oct-22 3:54
Ali Ibrahim jasim16-Oct-22 3:54 
AnswerRe: Dodger game with eventListener Pin
Jeremy Falcon26-Oct-22 12:26
professionalJeremy Falcon26-Oct-22 12:26 
QuestionHTML5 Nested drag and drop using vuejs2 Pin
Maseeha K1-Oct-22 0:40
Maseeha K1-Oct-22 0:40 
AnswerRe: HTML5 Nested drag and drop using vuejs2 Pin
Jeremy Falcon26-Oct-22 12:12
professionalJeremy Falcon26-Oct-22 12:12 
Questiontrying to get to grips with parsing from a JSON file Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 5:22
DSB Audio (David Sweeney-Bear)30-Sep-22 5:22 
AnswerRe: trying to get to grips with parsing from a JSON file Pin
Richard MacCutchan30-Sep-22 5:53
mveRichard MacCutchan30-Sep-22 5:53 
GeneralRe: trying to get to grips with parsing from a JSON file Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 6:42
DSB Audio (David Sweeney-Bear)30-Sep-22 6:42 
Thanks - that makes sense. Duff info from a post i read somewhere about putting JSON in script tag.

So, I think I've converted it to js correctly:

```
const videoList = [
    {
      "name":"Jolly Dead by Sebastion Lopez - DSB Audio Short Horror Story", 
      "index":0, 
      "thumbLink":"http://localhost/dsb/wp-content/uploads/JollyDead.webp", 
      "playLink": "https://youtu.be/ZUPCxQBL3Ik"
    },
    {
      "name":"Video Two", 
      "index":1, 
      "thumbLink":"http://localhost/dsb/wp-content/uploads/Vid2.webp", 
      "playLink": "https://youtu.be/Vid2"
    },
    {
      "name":"Vid Three", 
      "index":2, 
      "thumbLink":"http://localhost/dsb/wp-content/uploads/Vid3.webp", 
      "playLink": "https://youtu.be/Vid3"
    }
  ]

Throws no errors, now I'm wondering how to get the info out...
console.log(videoList[0]);

gives me all values at 0, i.e.
"name":"Jolly Dead by Sebastion Lopez - DSB Audio Short Horror Story",
     "index":0,
     "thumbLink":"http://localhost/dsb/wp-content/uploads/JollyDead.webp",
     "playLink": "https://youtu.be/ZUPCxQBL3Ik"

was just playing around trying to get the right syntax and ended up with:
console.log(videoList,name[0])

which returns an array of all the "name" values - the comma was a mis-type!

Confused again!
GeneralRe: trying to get to grips with parsing from a JSON file Pin
Richard MacCutchan30-Sep-22 6:49
mveRichard MacCutchan30-Sep-22 6:49 
GeneralRe: trying to get to grips with parsing from a JSON file Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 8:57
DSB Audio (David Sweeney-Bear)30-Sep-22 8:57 
GeneralRe: trying to get to grips with parsing from a JSON file Pin
Dom8615-Nov-22 5:33
Dom8615-Nov-22 5:33 
GeneralRe: trying to get to grips with parsing from a JSON file Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 6:35
DSB Audio (David Sweeney-Bear)30-Sep-22 6:35 
GeneralRe: trying to get to grips with parsing from a JSON file Pin
Richard MacCutchan30-Sep-22 6:50
mveRichard MacCutchan30-Sep-22 6:50 
AnswerRe: trying to get to grips with parsing from a JSON file Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 11:12
DSB Audio (David Sweeney-Bear)30-Sep-22 11:12 
AnswerRe: trying to get to grips with parsing from a JSON file Pin
jkirkerx14-Dec-22 13:25
professionaljkirkerx14-Dec-22 13:25 
QuestionSecond chart not react to data entered, why? Explain, please, how to solve the issue? Pin
Earl Lembertas27-Sep-22 11:35
Earl Lembertas27-Sep-22 11:35 
AnswerRe: Second chart not react to data entered, why? Explain, please, how to solve the issue? Pin
Pete O'Hanlon27-Sep-22 21:46
mvaPete O'Hanlon27-Sep-22 21:46 
GeneralRe: Second chart not react to data entered, why? Explain, please, how to solve the issue? Pin
Earl Lembertas28-Sep-22 1:00
Earl Lembertas28-Sep-22 1:00 
GeneralRe: Second chart not react to data entered, why? Explain, please, how to solve the issue? Pin
Pete O'Hanlon28-Sep-22 5:26
mvaPete O'Hanlon28-Sep-22 5:26 
QuestionWhy doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)24-Sep-22 4:39
DSB Audio (David Sweeney-Bear)24-Sep-22 4:39 
AnswerRe: Why doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)24-Sep-22 8:43
DSB Audio (David Sweeney-Bear)24-Sep-22 8:43 
AnswerRe: Why doesn't this script work as expected? Pin
Richard Deeming25-Sep-22 22:42
mveRichard Deeming25-Sep-22 22:42 
GeneralRe: Why doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 5:16
DSB Audio (David Sweeney-Bear)30-Sep-22 5:16 
GeneralRe: Why doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 5:31
DSB Audio (David Sweeney-Bear)30-Sep-22 5:31 
AnswerRe: Why doesn't this script work as expected? Pin
Jeremy Falcon26-Oct-22 12:36
professionalJeremy Falcon26-Oct-22 12:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.