Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for from php array to javascript (beginner)

Current License: CC BY-SA 4.0

13 events
when toggle format what by license comment
Sep 22, 2020 at 21:03 vote accept elazard
Jun 6, 2019 at 6:06 comment added Jawad Ahbab Ha ha, Congratulation. Nice to meet you. Have a nice day!!
Jun 5, 2019 at 23:27 comment added elazard hey man I managed to do it :) thanks a ton for your help and being nice. in the end you your answer helped me get there so thanks again! (and basically what messed with my head was a lost = in my for loop)
Jun 5, 2019 at 22:57 comment added elazard haha sure thing man I am not stopping yet (even if I am getting tired too lol) thanks a ton for your help :)
Jun 5, 2019 at 22:55 comment added Jawad Ahbab Ok, No problem, If you can't I will try to solve your problem. I jst need to sleep for a while.! Stay connected! Till than try yourself
Jun 5, 2019 at 22:50 comment added elazard well no I don't know I mean I ve been trying for a while now and I can't make it work. how would you approach what I am trying to do? basically I have a database with 4 columns article_id, Ean, brand, ref and I would like to have 4 input. Only the first one you can fill with the article number and when it matches one article number from the database javascript fills the 3 other inputs. it sounds simple enough but I can't make it work for the life of me. thanks man
Jun 5, 2019 at 22:16 comment added Jawad Ahbab Here you can check this [see only code, fiddle will not work] jsfiddle.net/hc95dLom
Jun 5, 2019 at 22:15 comment added Jawad Ahbab For my case it's working... Please try it again in another way! Thanks!
Jun 5, 2019 at 22:15 comment added elazard it's a .php file :)
Jun 5, 2019 at 22:10 comment added Jawad Ahbab Hey is your file is in .js / .html format? I think you are declearing all the <?php ... ?> as a string of the json.
Jun 5, 2019 at 22:08 comment added Jawad Ahbab Ok let me think again.. Please wait! πŸ˜…
Jun 5, 2019 at 21:42 comment added elazard hey man, thanks for your answer for I tried something like var json = '<?php echo json_encode($temp_articles) ?>'; var array_articles = JSON.parse(json); console.log(array_articles.narticle); but it throws me an error SyntaxError: JSON Parse error: Expected '}'
Jun 5, 2019 at 21:17 history answered Jawad Ahbab CC BY-SA 4.0

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /