- 👋 Hi, I’m @wzla
- 👀 I’m interested in coding ...
- 🌱 I’m currently learning JavaScript and C# ...
- 💞️ I’m looking to collaborate on ...
- 📫 How to reach me ...
wzla / blog Goto Github PK
View Code? Open in Web Editor NEW技术记录
技术记录
const element = document.querySelector('#element');
//old
element.style.height = '100px';
element.style.color = '#ffffff';
element.style.backgroundColor = '#000000';
// new
Object.assign(element.style, {
height: '100px',
color: '#ffffff',
backgroundColor: '#000000'
})
// 当前window对象
const currentWindow = window;
// or
const selfWindow = window.self;
// 父级window
const parentWindow = window.parent;
// 顶级window:浏览器窗口
const topWindow = window.top;
const uuid = window.crypto.randomUUID();
console.log(uuid);
// 'd4e2738c-f218-4dd4-a30f-0475f5ca3b9c'
function getQueryStringArgs() {
const qs = location.search.length > 0 ? location.search.substring(1): "",
args = {};
for (let items of qs.split("&").map(kv => kv.split("="))) {
const name = decodeURIComponent(item[0]),
value = decodeURIComponent(item[1]);
if (name.length) {
args[name] = value;
}
}
return args;
}
New:
const paramsString = "q=URLUtils.searchParams&topic=api"
const searchParams = new URLSearchParams(paramsString);
for (let p of searchParams) {
console.log(p);
}
searchParams.has("topic") === true; // true
searchParams.get("topic") === "api"; // true
searchParams.getAll("topic"); // ["api"]
searchParams.get("foo") === null; // true
searchParams.append("topic", "webdev");
searchParams.toString(); // "q=URLUtils.searchParams&topic=api&topic=webdev"
searchParams.set("topic", "More webdev");
searchParams.toString(); // "q=URLUtils.searchParams&topic=More+webdev"
searchParams.delete("topic");
searchParams.toString(); // "q=URLUtils.searchParams"
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.