Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 139863

fetch file data from url using js

$
0
0

i am sending input file from one page to another, how can i send file data from abc.html to ac.html

1)abc.html

<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script></head><body>
<div>
    <form action="adc.html">
        <input type="file" name="file" id="file12">
        <input type="submit">
    </form>
</div>
<script>
    $('form').on('click',function(){

        $(this).serialize();
    })
</script>

how can i fetch and show file data to ac.html file
2)ac.html

<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script></head><body>
<div id="poemdisplay"></div>
<script src="module">
    var poemDisplay=getElementById('poemdisplay')


    fetch(url).then(function(response) {response.text().then(function(text) {
poemDisplay.textContent = text;});});

</script></body></html>

}


Viewing all articles
Browse latest Browse all 139863

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>