Add Parameters To Form Action

javascript

I need to the add a JavaScript variable to a link in action form. Is that possible? JavaScript function: <script> function parameter() { function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { vars[key] = value; }); return vars; } var vpid = getUrlVars()[“pid”]; } //var link = “second_02.html”

Add Parameters To Form Action Read More »

React – Cheatsheet

all-scribbly react

=> The React script allows us to write React components => The ReactDOM script allows us to place our components and work with them in the context of the DOM ReactDOM.render(<Greeting />, document.getElementById(‘root’)); Copy Translating the line of code above to English would sound something like this; Use ReactDOM’s render method to render the Greeting

React – Cheatsheet Read More »

Add “_blank”

all-scribbly javascript

/* here are two different ways to do this */ //using jquery: $(document).ready(function(){ $(‘#link_other a’).attr(‘target’, ‘_blank’); }); // not using jquery window.onload = function(){ var anchors = document.getElementById(‘link_other’).getElementsByTagName(‘a’); for (var i=0; i<anchors.length; i++){ anchors[i].setAttribute(‘target’, ‘_blank’); }} // jquery is prettier. 🙂 Copy You could also add a title tag to notify the user that you

Add “_blank” Read More »

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 defined The problem It must

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-t The 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

DocReady – Javascript Style Read More »

CSS Functions

all-scribbly css

https://css-tricks.com/complete-guide-to-css-functions/ Like any other programming language, CSS has functions. They can be inserted where you’d place a value, or in some cases, accompanying another value declaration. Some CSS functions even let you nest other functions within them! More In programming, functions are a named portion of code that performs a specific task. An example of

CSS Functions Read More »

CSS Line Height

all-scribbly design - layout

ALL DEAD: https://seek-oss.github.io/capsize/ https://github.com/seek-oss/capsize NEW KING –  <hr> https://michaeltaranto.github.io/slides-teach-css-to-talk-design/ https://css-tricks.com/how-to-tame-line-height-in-css/ In CSS, line-height is probably one of the most misunderstood, yet commonly-used attributes. As designers and developers, when we think about line-height, we might think about the concept of leading from print design — a term, interestingly enough, that comes from literally putting pieces of

CSS Line Height Read More »