How to Input and Output {Local text file} instead of using ActiveXObject (latest version of Chrome or IE 11) using JavaScript

Henry WenHan Lee

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!

Henry WenHan Lee

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).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to Input and Output {Local text file} instead of using ActiveXObject (latest version of Chrome or IE 11) using JavaScript

From Dev

Text input placeholders are broken in latest version of Chrome?

From Dev

IE 11 lock the file when using HTML input=file tag

From Dev

Unable to focus an input using JavaScript in IE11

From Dev

Read a local text file using Javascript

From Dev

Why does this javascript NOT work on Windows 8.1's IE11? (It works on the latest version of Firefox, Chrome, even Windows 7's IE11)

From Dev

How to run tests without passing local relative path in Action class for the IE/Chrome WebDriver and run using only maven dependencies in pom file

From Dev

how to write input text in file using java

From Dev

Unable to set focus and cursor to input text using javascript in Chrome Console

From Dev

How can I load a local version of a javascript file instead of a remote version?

From Dev

Is it possible to read content from a local text file using Javascript?

From Dev

Load text from local .txt file into html textarea using JavaScript

From Dev

How to get output of particular text from text file using batch?

From Dev

How to write a configuration file for chrome extension using a local script

From Dev

window.ActiveXObject difference in IE11

From Dev

selectNodes function of ActiveXObject does not work in IE 11

From Dev

How to write a text file on server using JavaScript?

From Dev

How do I input text via an HTML form and retrieve data from a JSON file as a response using Javascript?

From Dev

Java file executing using ActiveXObject only works when placing in Desktop

From Dev

Using jQuery instead of JavaScript how to highlight single line of text in textarea

From Dev

How to write output of "java -version" to a text file?

From Dev

Open local files(file://) using Chrome

From Dev

How to loop over text in a file and send output using sendmail?

From Dev

How to extract between to tokens in text file using bash and manipulate output

From Dev

how to detect IE11 using jquery

From Dev

how to detect IE11 using jquery

From Dev

How to set input text color, but not placeholder color, in IE11

From Dev

Make input text disabled/readonly in IE9 and below using javascript/jQuery

From Dev

Make input text disabled/readonly in IE9 and below using javascript/jQuery

Related Related

  1. 1

    How to Input and Output {Local text file} instead of using ActiveXObject (latest version of Chrome or IE 11) using JavaScript

  2. 2

    Text input placeholders are broken in latest version of Chrome?

  3. 3

    IE 11 lock the file when using HTML input=file tag

  4. 4

    Unable to focus an input using JavaScript in IE11

  5. 5

    Read a local text file using Javascript

  6. 6

    Why does this javascript NOT work on Windows 8.1's IE11? (It works on the latest version of Firefox, Chrome, even Windows 7's IE11)

  7. 7

    How to run tests without passing local relative path in Action class for the IE/Chrome WebDriver and run using only maven dependencies in pom file

  8. 8

    how to write input text in file using java

  9. 9

    Unable to set focus and cursor to input text using javascript in Chrome Console

  10. 10

    How can I load a local version of a javascript file instead of a remote version?

  11. 11

    Is it possible to read content from a local text file using Javascript?

  12. 12

    Load text from local .txt file into html textarea using JavaScript

  13. 13

    How to get output of particular text from text file using batch?

  14. 14

    How to write a configuration file for chrome extension using a local script

  15. 15

    window.ActiveXObject difference in IE11

  16. 16

    selectNodes function of ActiveXObject does not work in IE 11

  17. 17

    How to write a text file on server using JavaScript?

  18. 18

    How do I input text via an HTML form and retrieve data from a JSON file as a response using Javascript?

  19. 19

    Java file executing using ActiveXObject only works when placing in Desktop

  20. 20

    Using jQuery instead of JavaScript how to highlight single line of text in textarea

  21. 21

    How to write output of "java -version" to a text file?

  22. 22

    Open local files(file://) using Chrome

  23. 23

    How to loop over text in a file and send output using sendmail?

  24. 24

    How to extract between to tokens in text file using bash and manipulate output

  25. 25

    how to detect IE11 using jquery

  26. 26

    how to detect IE11 using jquery

  27. 27

    How to set input text color, but not placeholder color, in IE11

  28. 28

    Make input text disabled/readonly in IE9 and below using javascript/jQuery

  29. 29

    Make input text disabled/readonly in IE9 and below using javascript/jQuery

HotTag

Archive