text: [{"Owner":"MackeyK24","Date":"2016-11-02T20:36:18Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tAre there any facilities to dynamically load javascript in babylon js...\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIf not what it the recommended way to load javascript from a string?\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIs window.eval ok to use in a custom scene loader (like objFileLoader.ts)?\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIf i use window.eval to dynamically load javascript_co_ will it be acceptable code to submit to github project?\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"joshcamas","Date":"2016-11-02T20:40:59Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tjQuery has the ability built in_dd_ jQuery.getScript()\n_lt_/p_gt_\n\n_lt_p_gt_\n\tAlternatively you can just load the file however you want (with the fileloader.ts_co_ or any other way) and then run eval(). I *think* that_t_s the only way to evaluate js. _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"JohnK","Date":"2016-11-02T20:52:58Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHow about this\n_lt_/p_gt_\n\n_lt_pre_gt_\n_lt_code_gt_var url _eq_ _qt_http_dd_//PATH/myFile.js_qt__sm_\nvar s _eq_ document.createElement(_qt_script_qt_)_sm_\ns.src _eq_ url_sm_\ndocument.head.appendChild(s)_sm_\n\ns.onload _eq_ function () {\n   //Use the script now\n}_lt_/code_gt__lt_/pre_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"MackeyK24","Date":"2016-11-02T23:06:29Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tI need to dynamically load script i already have in a string... just winding if the babylon folks would DISALLOW any code with _t_eval_t_ or if that is ok...\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI hope it is... because is seems like the only way to _t_eval_t_ string script _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2016-11-03T15:44:30Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tWhat do you want to PR? can you describe the code?\n_lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2016-11-04T15:41:24Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tPR _eq_ _qt_pull request_qt__co_ MackeyK24  (in case you didn_t_t know).  It is the approved way to contribute to BabylonJS framework source @ GitHub. \n_lt_/p_gt_\n\n_lt_p_gt_\n\tWere you talking about contributing to BabylonJS framework... via GitHub pull request?  That is why Deltakosh is asking this.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_strong_gt_IF_lt_/strong_gt_ you were referring-to submitting a project... to YOUR GitHub repository_co_ then no problems... use eval in your projects_co_ if you please.   But it is wise to learn about the potential hazards of using eval.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI just wanted to clarify a possible mis-understanding.  No _t_eval rules_t_ for your own GitHub-based project.  Possibly SOME _t_eval rules_t_ for contributions to Babylon.js core.  _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\tOk bye.  _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"royibernthal","Date":"2016-11-04T16:15:12Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tI believe he meant contributing to the bjs repo in case it doesn_t_t already have built in js loading functionality.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tMackey why would you need to use eval? Basically it should be avoided whenever possible_co_ it_t_s best practice to not ever use it_co_ especially not in an open source project used by many people.\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2016-11-06T11:41:13Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t*nod*  I_t_m no client-server guy_co_ but... let_t_s pretend the server needed to change a _qt_world_qt_ weather condition... for all listening clients.  There_t_s really 2 ways to handle this.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t1.  Put a weather-changer function in everyone_t_s client JS (at auth-in/initial-client-load)... and then when it_t_s time to make it rain_co_ send a packet (a weather-change packet-type?) to all clients... saying WHICH function to run (if it is not already TYPED as a weather change packet type)_co_ and include the needed data FOR that function... to make it rain.  In other words_co_ send data for the already-onboard weather changer function.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t2.  Send the entire make-it-rain function_co_ in a packet... to all clients_co_ and then _qt_order_qt_ all clients to execute the arriving function... via eval.  This is where I would use eval... if I were me. _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt_  Client-side packet-handling would be very simple_co_ this way.  Unpack the packet_co_ and execute whatever JS was found within.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tBut I_t_m just speculating.  It_t_s not about me.  _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"MackeyK24","Date":"2016-11-06T14:25:51Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tNevermind... I just gonna pull that little feature from the Unity Exporter/Editor plugin _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\tIf i anna dynamic load from string... i have had success creating\n_lt_/p_gt_\n\n_lt_p_gt_\n\tvar s _eq_ document.createElement(_t_script_t_)_sm_\n_lt_/p_gt_\n\n_lt_p_gt_\n\ts.async _eq_ false_sm_\n_lt_/p_gt_\n\n_lt_p_gt_\n\ts.textContent _eq_ _qt_javascript code_qt__sm_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tso far that works load javascript from a string\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]