Software Archive
Read-only legacy content
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
17065 Discussions

load csv in select

Luca_P_
Beginner
64 Views

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

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
64 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