Text in Hype after exporting it to HTML

Lol,

This does work, and I am using it a lot.
Incidentally I have just completed writing code to do similar to this but with a private (company domain) google share group using app-script as opposed to a public google jsonp. I can directly access the drive files. Works amazingly well actually.

But I was actually thinking they just need to use your XMLHttpRequest code to do this.

Which means they just need external .txt file/s which the client will understand.

	 <script  type="text/javascript"> function myCallback(hypeDocument, element, event){ 
  

var request = new XMLHttpRequest();
request.open('GET', '/sometext.txt', true);

request.onload = function() {
  if (request.status >= 200 && request.status < 400) {

    var obj =  request.responseText 
 
 
 document.querySelector('.text1').innerHTML = obj

  } else {


  }
};

request.onerror = function() {

};

request.send();

  
  
   } 

if("HYPE_eventListeners" in window === false) {
window.HYPE_eventListeners = Array();

the text file can be text with html

<h1>line one</h1>
    <br>

    line  

or plain text.

2 Likes