index.html/styles.css/scripts.js...

User 2719032 Photo


Registered User
11 posts

I created index.html/styles.css/scripts.js files.
They Work on two other places, but not the CoffeeCup HTML Editor.

If I leave all three in a single file it does work.
If I separate css & js to ext. files, it fails.
All help much appreciated, thanx

index:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Ref Test</title>

<!-- Load external CSS styles -->
<link rel="stylesheet" href="styles.css">

</head>
<body>
<hl>Please show me John 3:16 or Gen 1:1 thanx</hl>

<!-- Load external JavaScript -->
<script src="scripts.js"></script>

</body>

</html>

css:
/* Place your CSS styles in this file */

.rtTooltip {
width: 800px;
}
.rtTooltipHeader {
font-size: 36px;
line-height: 36px;
height: 36px;
padding: 10px 20px;
}
.rtTooltipBody {
font-size: 36px;
}

js:
/* Place your JavaScript in this file */
var refTagger = {
settings: {
bibleVersion: "NKJV",
customStyle : {
heading: {
backgroundColor : "#000000",
color : "#f31b1b",
fontSize : "18px"
},
body : {
color : "#000000",
fontSize : "38px"
}
}
}
};
(function(d, t) {
var n=d.querySelector("[nonce]");
refTagger.settings.nonce = n && (n.nonce||n.getAttribute("nonce"));
var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
g.src = "https://api.reftagger.com/v2/RefTagger.js";
g.nonce = refTagger.settings.nonce;
s.parentNode.insertBefore(g, s);
}(document, "script"));


User 122279 Photo


Senior Advisor
14,450 posts

No problem here with the HTML Editor.
Attachments:
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 379556 Photo


Registered User
1,535 posts

I'm wondering whether perhaps it seemed not to work in The HTML Editor because
1. the .js file had not been saved since its last edit, and so the browser preview (F9) didn't work, or
2. it was the split-screen preview (F12) that was used, and it didn't take account of the .js file.

If it was item 1 above, the answer is, of course, to ensure saving .js files before a browser preview. If it was item 2, then I suspect the Tools > Preferences > Browser Testing may need to be set as follows:
Internal Preview uses - Internet Explorer 11, and ensure the 'Disable Scripts in Preview' box is not ticked.

Frank

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.