Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var quizUrl = 'http://www.lipsum.com/';
- var myHeaders = new Headers();
- myHeaders.append('Content-Type', 'text/html');
- fetch(quizUrl,{
- mode: 'no-cors',
- method: 'get',
- headers: myHeaders
- }).then(function(response) {
- response.text().then(function(text) {
- console.log(text);
- })
- }).catch(function(err) {
- console.log(err)
- });
- fetch('/url/to/get/html/file')
- .then((res) => {
- return res.text();
- })
- .then((data) => {
- $('#container').html(data);
- }
Add Comment
Please, Sign In to add comment