I'm Jakub Augustýn, a software developer from the Czech Republic.
...and morekubikaugustyn / kubikaugustyn.github.io Goto Github PK
View Code? Open in Web Editor NEWKubíkovo webové stránky
Kubíkovo webové stránky
Dlouhý JavaScript:
//prvni menu var menu1 = new CSkryvaneMenu("Menu1", 100) menu1.NovaPolozka ( "Knihy", "location.href='http://www.vltava.cz'", "Velký výběr knih"); menu1.NovaPolozka ( "Články", "location.href='http://programovanie.pc.sk'", "články o programování"); menu1.Cara(); //-------------------------------- menu1.NovaPolozka ( "1", "location.href='http://www.javafile.com'", "Velký výběr skriptů"); menu1.x=100; //menu1.y=100; //druhe menu var loutky = new CSkryvaneMenu("Loutky", 150); Loutky.NovaPolozka ( "Spejbl", "SluzbaSpejbl()", "Info Spejbl"); Loutka.NovaPolozka ( "Hurvínek", "alert('Služba Hurvínek')", "Info Hurvínek"); loutky.Cara(); //----------------------------- Loutky.NovaPolozka ( "Hamo", "alert('Služba Hamo')", "Info Hamo"); loutky.classMenu = "menu2"; loutky.classPolozka = "polozka2"; loutky.classApolozka = "Apolozka2"; //priklad funkce volame z menu function SluzbaSpejbl() { alert("Hlasi se sluzba Spejbl"); } function CPolozkaMenu(Text, Sluzba, Info) { //konstruktor this.Text = Text; this.Sluzba = Sluzba; this.Info = Info; } function CSkryvaneMenu(Meno, Sirka) { //argumenty this.Meno = Meno; this.Sirka = Sirka; //nastavitelné vlastnosti //souřadnice .. pokud nesjsou defin. myš this.x = null; this.y = null; //třídy prvků menu this.classMenu = "Menu"; this.classPolozka = "Polozka"; this.classApolozka = "Apolozka"; this.Polozky = new Array(); this.divMenu = null; this.divX = null; this.NovaPolozka = NovaPolozka; this.Cara = Cara; this.Zobraz = Zobraz; this.Skryj = Skryj; this.DejPolozku = DejPolozku; this.Nad = Nad; this.Mimo = Mimo; this.Klepnuti = Klepnuti; //definice metod function NovaPolozka(Text, Sluzba, Info) { this.Polozky.push(new CPolozkaMenu(Text, Sluzba, Info)); } function Cara() { this.Polozky.push(null) } function Zobraz(x, y) { var Menu = document.createElement('div'); var Atr = document.createAttribute("class"); Atr.value = this.classMenu; Menu.setAttributeNode(Atr); var sTxt = ""; sTxt+= '<div id="' + this.Meno + '_X" '; sTxt+= 'onclick="' + this.Meno + '.Klepnuti();'; sTxt+= 'onmouseover="' + this.Meno + '.Nad()' } }
Cykly v JavaScriptu slouží k opakování něčeho. Například když chci na stránku umístit dvacet divů, můžu využít cyklus.
function addDivs(parentId, count) {
var divsHTML = ""
for (var col=0; col<count; col++) {
divsHTML += "<div>" + col + "</div>"
}
document.getElementById(parentId).innerHTML = divsHTML
}
@kubikaugustyn oky???
<!DOCTYPE html>
<html>
<head>
<script>
function addDivs(parentId, count) {
var divsHTML = document.getElementById(parentId).innerHTML
for (var col=0; col<count; col++) {
divsHTML += "<div>Sloupec:" + col + "</div>"
}
document.getElementById(parentId).innerHTML = divsHTML
}
</script>
</head>
<body>
The content of the body element is displayed in your browser.
<p id="divs"></p>
<button onClick="addDivs('divs', 6)">Add Divs</button>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
function a() {
return fetch('http://localhost:3000/Data/Linka958_Mercator.geojson')
.then((response) => response.json())
.then((responseGeojson) => {
console.log(responseGeojson)
return [responseGeojson.type];
})
.catch((error) => {
console.error("My error:", error);
});
}
</script>
<button onclick="a()">ahoj</button>
</body>
</html>
def isNumber(v):
"""
:param v:
:return:
>>> isNumber(3.5)
True
>>> isNumber(365)
True
>>> isNumber("Ahoj")
False
"""
return isinstance(v, (int, float))
viz demo
function copyToClip(str) {
function listener(e) {
e.clipboardData.setData("text/html", str);
e.clipboardData.setData("text/plain", str);
e.preventDefault();
}
document.addEventListener("copy", listener);
document.execCommand("copy");
document.removeEventListener("copy", listener);
};
function downloadData (serverURL, fileName) {
fetch(serverURL)
.then(response => {
response.blob().then(blob => {
let url = window.URL.createObjectURL(blob);
let a = document.createElement('a');
a.href = url;
a.download = fileName;
a.click();
});
});
}
Zkouška
HTML:
<!DOCTYPE html>
<html>
<body>
Toto jsou moje youtube videa:<br><br>
Závody Sušice 2019:
<iframe width="420" height="345" src="https://www.youtube.com/embed/5TkdSp2V_04">
</iframe>
<br><br>
Reproduktor:
<iframe width="420" height="345" src="https://www.youtube.com/embed/KldsWj3w2r8">
</iframe>
<br><br>
Jak otevřít trezor z Lega:
<iframe width="420" height="345" src="https://www.youtube.com/embed/ZoZ5LUe5s4Q">
</iframe>
</body>
</html>
JavaScript:
var a = 5
var b = 7
var c = a + b
console.log(c)
CSS:
body {
background-color: blue;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.