0
Under review

Compiling and Running HTML and JavaScript (Ipad)

Joshua Geddes 10 years ago updated by Alexander Blach (Developer) 1 month ago 5
I was wondering how to run HTML and JavaScript? I think you can in the app but I am just wondering how to do it? Thanks.
Under review
Hello,

to preview HTML and JavaScript, open the HTML file and tap on the "glasses" button in the top right corner.
+1

I was using only javascript, and trying to console.log() something and does not work, I don't see anything in the javascript console?
I also don't know how to reference a javascript file and my CSS file in my html file with textastic.
Thanks.

 

Hello,


to reference a JavaScript file from a HTML file, insert a tag like this:


<script src="file.js"></script>


You can reference a CSS file like this:


<link rel="stylesheet" type="text/css" href="style.css">


I hope this helps.


so if i had a file, that just had console.log('hi'), inmy file.js, I should be able to see the log right? because I can't, even referencing the js file as you showed with the script tag. 

If you have a HTML file that references that JavaScript file and then preview the HTML file, then you should see the console message of the referenced JavaScript file in the web preview.