Is it possible for IE9 to load local files?

Asked 1 years ago, Updated 1 years ago, 109 views

What I want to do is to have the file name specified by the input element as shown below, and when I press the button, I want to get the contents.
Assume that the csv file is loaded.
IE10 and later use FileAPI, but IE9 does not work.

I thought I could write it like below, but this code didn't work.

Sorry, I didn't write any restrictions.
I don't want to use MS-specific constraints such as ActiveX.
However, I think it's okay to use a major library such as JQuery that absorbs the difference.

<html>
<head>
<title>Sample</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">/script>
</head>
<body>
<script type="text/javascript">

    function CSVTEST() {
        value = document.getElementById("csvfile").value;
        alert(em);

        $.get(em, function(data){
            alert(data);
        });
    };
</script>

<input id="csvfile" type="file">
<input type="submit" value="OK" onclick="CSVTEST()">

</body>
</html>

jquery html internet-explorer

2022-09-30 21:11

1 Answers

See below for more information.
https://qiita.com/tekka/items/1bf440ccd50bb4171886


2022-09-30 21:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.