Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Luca_P_
Beginner
55 Views

load csv in select

Hi,

I'm beginner in Intel XDK. I'm trying to write my first app, helping with examples and tutorials.

I would like to load a csv file into a select. In PHP I write so:

        $file=plugin_dir_url(__FILE__).'coefficienti.csv';
        $delimitatore=";";
        if (($fp = fopen($file,"r")) !== false){
            // for each row of file
            while (($data = fgetcsv($fp,1000,$delimitatore)) !== false) {
                //insert row into select
                $echo .= "<option value='".$data[1]."|".$data[0]."'>".$data[0]."</option>";
                }
            fclose($fp);
        }
        $opzioniEta=$echo;

Now, how can I convert this in Js, to add in app.js file?

I'm using Xdk 3900 on Windows 7.

Thanks

Luca

Tags (2)
0 Kudos
1 Reply
PaulF_IntelCorp
Employee
55 Views

This forum is not about teaching how to write JavaScript and communicate with a server. For that you are better served by the many JavaScript enthusiast sites on the Internet. Especially HTML5rocks and W3CSchools and Stack Overflow.

The XDK creates a standard Cordova CLI app (aka PhoneGap), so solutions that work with Cordova also work with the XDK.

Reply