Originally Posted by
GK5
I am publishing.
I really don't understand what's going wrong. From your screenshot I can see that it does indeed work. But it doesn't work for me. I am attaching an example of what I get to see (web display) and also a piece of the html code.
Here you see that the correct file is being referred to (triple checked).
The same can be seen in xara itself (xaradisplay).
I really have no idea what the problem is.
Maybe I should just leave the banner out when we can't find to reason?
frank
Frank, as shown, you code is looking for a sub-folder, object_data, to get the text file.
As this is different to what you uploaded previously, you have to check you are publishing infotekst.txt into the http://www.fccweb.epizy.com/object_data/ folder.
UPDATE: I have checked and the file is there!
You do not need to include the full path, you just need await fetch ("object_data/infotekst.txt");
Code:
async function main() {
afile = await fetch('object_data/infotekst.txt');
amsg = await afile.text();
document.querySelector('marquee#message font').innerText = amsg;
}
main();
I have just made these changes on my local server and it works fine.
Using the full URL may be hitting a CORS issue.
I also had a play and changed the marquee background;
Code:
<marquee id="message" direction="left" height="75" width="500" scrollamount="10" bgcolor="transparent">
<font color="red" face="Verdana, Geneva, sans-serif" size="+3">This is a test ---</font>
</marquee>
Here are my plays published:
The path to the message is a relative URL: object_data/infotekst.txt
http://acorn.xara.hosting/FCC/index.htm - I removed the gap after fetch
http://acorn.xara.hosting/FCC/index-a.htm - I altered the marquee background
Acorn
Bookmarks