Aye, but in a perfect world.

 
Martinat: Uhh preferably not? im using jquery atm

Riemer: I tried dynatable or something but it didnt work with json ajax

Pawlik: Did you try remapping the json response into something dynatable could consume?

Hank: Gkwhc, that’s doable, should be easy

Gerty: But i couldnt figure out how to dynamically create tables with dyntable

Mackert: Create them in js not pre-existing in html

Tobler: Errmano: but still with node.js/io.js? or built in functions?

Stohl: Gkwhc, node.js is what runs your javascript code, it’s not a js library like jquery or something

Enck: How are you running your js code on the server now?

Steininger: Errmano: oh its all in html atm

Stoutenger: Giraffe_, i’m having a hard time understanding your code here

Pacenta: Gkwhc, can you describe what you’re trying to build?

Chute: Giraffe_, what is setTables? it doesnt look like it’s defined. same with find_in_array

Gillim: So i have an discussion bot which saves the runs, and this is supposed to make a table based on the player.game, and then populate it with all players that have the same game

Juaire: I didnt include find_in_array; it finds an index in an array

Rydelek: Why not use .indexOf ?

Nosal: Errmano: sure, basically there’s a folder of images. i’d like to get a list of images in that folder, populate an array with the list, and display images selected at random. that’s the first thing i’d like to achieve. the next step is to get 100px x 100px sections at random of the selected image

Acal: Trying to understand if there’s a difference between find_in_array and Array#indexOf

Kirchberg: Function find_in_arrayarr, name, value {for var i = 0, len = arr.length; ilen; i++ {if name in arri && arriname == valuereturn i;};} var x = {“name”: “Hey”}, {“name”: “Hi”}; var y = find_in_arrayx, ‘name’, ‘Hey’; console.logy;

Gerrero: Giraffe_: undefined; Console: 0

Swingen: Function find_in_arrayarr, name, value {for var i = 0, len = arr.length; ilen; i++ {if name in arri && arriname == valuereturn i;};} var x = {“name”: “Hey”}, {“name”: “Hi”}; var y = find_in_arrayx, ‘name’, ‘Hi’; console.logy;

Gerrero: Giraffe_: undefined; Console: 1

Sortore: Its an array of objects errmano, indexOf didnt want to play nice with keys

Cholewinski: It has a check to see if it exists at all but i removed that for the example

Gorby: And i forgot about setTables; it sets the tables array with all the names so it doesn’t duplicate them for every player

Dallmeyer: Ifobjectgame, then push obj, otherwise it doesnt exist so add it

Gean: Gkwhc, sounds like you could load a .json file with the list of images. you could generate that json statically or you’d need a server side app to generate it. if you want to use a web server, you could use node.js and ‘connect’ library and ‘fs’ module

Buelow: Giraffe_, what’s the issue with your current code? are the tables not rendering or something?

Barco: Giraffe_, drawTable method has a reference to ‘parent’, where is that defined?

Dick: Thats a container div that is hard-coded in html

Sprowl: Var parent = $’.container’;

Pappenheim: It works great the first time before the timeout, then it adds a new table and duplicates the entries

Schink: Ok, so it’s not undefined

Gullage: Http://i.imgur.com/4wwTgR6.png

Langshaw: The updates contain all data or just the changed bits since last update?

Ferrebee: So every timeout it adds a new table with no data and adds new data to the old ones

Matsushita: Well you’re using id’s so that’s going to explain why the other tables are empty after duplication

Niederkorn: I did have it working by completely removing the tables .remove, except it would flash white on screen as it wasnt instant

Pulliam: Aye, but in a perfect world those other tables dont exist :