1

In Coda on my iPad Pro I have the following two files in a single directory that I named assets. When I try to preview the template.html file either in Coda or Safari (in side by side mode) I cannot get any interaction with javascript calls on events.

I have consulted the panic library regarding this and tried searching if similar issues have been encountered, but to no avail. The documentation clearly states that html/css/javascript rendering is supported by the preview functionality of Coda.

I have tried including the script directly in the head, the body, importing in a script tag and importing in a source tag and none have worked. CSS styling works as expected. I have tried many iterations that I won't list below, but this is the simplest case that I'm currently working with.

assets/template.html

<!DOCTYPE html>
<html>
    <head>
        <source type="text/javascript" src="assets/scripts.js"></source>
    </head>
    <body>
        <h1 class="myheader" id="theheader">Hello?</h1>
        <button onclick="doStuff()">click me</button>
    </body>
</html>

assets/scripts.js

doStuff(){
    document.getElementById('theheader').style.color = 'red';
}
Nimantha
  • 6,405
  • 6
  • 28
  • 69
M. Francis
  • 11
  • 3
  • did you try with src="scripts.js"? – Razib Mollick May 11 '18 at 15:57
  • I have tried both src="scripts.js” and src="/scripts.js”. I just retested to be sure. It feels like it's a particular issue with Coda itself and hoping someone with experience with Coda on iPad will be able to help. – M. Francis May 11 '18 at 20:14

0 Answers0