Free javascript Hosting


onboarding.js

Uploaded on May 25 2022 18:26 by lewis

function loadForm(){
newInput="<p>Item: <input type="+"text"+" name="+"item"+"/></p>";
form="hello world!!!";
document.getElementById("onboarding").innerHTML=newInput;
}

function getParameterByName(name, url = window.location.href) {
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}

// query string: ?foo=lorem&bar=&baz
var foo = getParameterByName('formType'); // "lorem"
var bar = getParameterByName('bar'); // "" (present with empty value)
var baz = getParameterByName('baz'); // "" (present with no value)
var qux = getParameterByName('qux'); // null (absent)


var div = document.createElement('div');
div.innerHTML = "my <b>new</b> skill - <large> " + foo + " DOM maniuplation!</large>" ;
div.style.color = 'red';
div.setAttribute('class', 'myclass');
document.body.appendChild(div);
newItem();

Back to list