javascript

Uncaught Reference Error

all-scribbly javascript
app.js”use strict”;var tb = { rahmen: { eigenschaften: [ “hochwertig”, “verwindungssteif”, “vergleichsweise verwindungssteif”, “sehr verwindungssteif”, “sehr hohe Verwindungssteifigkeit”, “hohe Steifigkeit” ] }};index.html<!DOCTYPE html><html lang=”en”><head> ((Some Head-Tags)) <script src=”dist/app.js” defer></script> ((Some Head-Tags))</head><body> <div class=”container”> <section> <h1>Test</h1> <script> console.log(tb.rahmen.eigenschaften[3]); </script> </section> </div></body></html>Error Message Uncaught ReferenceError: tb is not definedThe problem It must be something simple, but after […]

Uncaught Reference Error Read More »

JS To Insert CSS Into Page

all-scribbly javascript
u can also do this using DOM Level 2 CSS interfaces (MDN): var sheet = window.document.styleSheets[0]; sheet.insertRule(‘strong { color: red; }’, sheet.cssRules.length);  …on all but (naturally) IE8 and prior, which uses its own marginally-different wording: sheet.addRule(‘strong’, ‘color: red;’, -1);  There is a theoretical advantage in this compared to the createElement-set-innerHTML method, in that you don’t

JS To Insert CSS Into Page Read More »

DocReady – Javascript Style

all-scribbly javascript
https://stackoverflow.com/questions/9899372/pure-javascript-equivalent-of-jquerys-ready-how-to-call-a-function-when-tThe simplest thing to do in the absence of a framework that does all the cross-browser compatibility for you is to just put a call to your code at the end of the body. This is faster to execute than an onload handler because this waits only for the DOM to be ready, not for

DocReady – Javascript Style Read More »

Javascript – Numbers

all-scribbly coding javascript
9e-6 Scientific notation uses the letter ‘e’ to represent an exponential value. This number is the same as 9 times 10 to the negative 6 power: 9 * 10^-6 or 0.000009++++++++Numbers in JavaScript are as straightforward as they sound; you don’t need any special syntax for numbers, you write them straight into JavaScript.In JavaScript, numbers can

Javascript – Numbers Read More »