1

Here is my Javascript code:

function initMap() {            
      // Define the LatLng coordinates for the polygon.
      var RoundList = [
          {lat: 25.774, lng: -80.190},
          {lat: 18.466, lng: -66.118},
          {lat: 18.400, lng: -65.118},
          {lat: 19.551, lng: -60.164},
          {lat: 32.321, lng: -64.757}
      ];

What I'm going to do is load a local text file to change 【var RoundList】.

I've done the following Output methods:

function WriteToFile(text) {

        var fso = new ActiveXObject("Scripting.FileSystemObject");

        var f="c:\\test.txt";

        var s = fso.CreateTextFile(f, true);
        s.WriteLine('<?xml version=”1.0″ encoding=”utf-8″ ?>');
        s.WriteLine(text);
        s.Close();
    }

It's useless in the latest version of IE or Chrome.

Chrome Gives an Error:

(X)Uncaught ReferenceError: ActiveXObject is not defined.

IE does nothing!

Does anybody know how to implement Input and Output text file? Please help me to figure it out, I'm appreciate!

  • Marking "Solved" in your question title is not the way to close a question. Please mark an answer as accepted, or post the answer yourself. – trincot Jun 03 '16 at 08:49

1 Answers1

0

Saving text in a local file in Internet Explorer 10

Thanks to @Edward Z. Yang, who answered this question.

This method works on Chrome (Latest version) and IE (Latest version).

Community
  • 1
  • 1