Emmersive Learning
The window object is the global object in a browser environment. All global variables and functions become properties and methods of the window object. window:👇
// 1. Getting Window Dimensions (innerWidth and innerHeight)
console.log('Window width:', window.innerWidth);
console.log('Window height:', window.innerHeight);
// 2. Opening a New Window or Tab (window.open)
let newWindow = window.open('https://www.example.com', '_blank');
// 3. Alert Box (window.alert)
window.alert('Welcome to the JavaScript BOM demo!');
// 4. Confirm Dialog (window.confirm)
let isConfirmed = window.confirm('Do you want to proceed with the next step?');
if (isConfirmed) {
console.log('User confirmed!');
} else {
console.log('User canceled!');
}
// 5. Prompt Dialog (window.prompt)
let userInput = window.prompt('Please enter your name:');
if (userInput !== null) {
console.log('Hello, ' + userInput);
} else {
console.log('User canceled the prompt.');
}
// 6. Setting a Timeout (window.setTimeout)
window.setTimeout(() => {
console.log('This message is displayed after 2 seconds.');
}, 2000);
// 7. Repeating Action at Intervals (window.setInterval)
let counter = 0;
let intervalId = window.setInterval(() => {
counter++;
console.log('Interval count:', counter);
if (counter === 5) {
window.clearInterval(intervalId); // Stops the interval after 5 counts
}
}, 1000);
// 8. Closing the New Window (window.close)
// Delay the close so the user can see the opened window
window.setTimeout(() => {
if (newWindow) {
newWindow.close(); // Closes the newly opened window
console.log('New window closed.');
}
}, 5000);
// 9. Accessing and Redirecting with URL (window.location.href)
console.log('Current URL:', window.location.href);
// Redirect to a new URL after 7 seconds
window.setTimeout(() => {
window.location.href = 'https://www.anotherexample.com';
}, 7000);
// 10. Reloading the Page (window.location.reload)
// Uncomment the next line to reload the page (be careful, it reloads immediately!)
// window.location.reload();
// 11. Navigating through the Browser History (window.history.back and window.history.forward)
window.setTimeout(() => {
console.log('Navigating through history...');
window.history.back(); // Go back one page in history
}, 10000);
window.setTimeout(() => {
window.history.forward(); // Go forward one page in history
}, 12000);
❤1
Forwarded from Muhammed Teshome
ከዚህ ቻናል በተጨማሪ በሌሎች የምገኝባቸው ፡
If you are interested in Coding, join @EmmersiveLearning .
if you want to have the latest Ai News, tips and prompts, join @MuhibAi.
Love you all. ❤️
If you are interested in Coding, join @EmmersiveLearning .
if you want to have the latest Ai News, tips and prompts, join @MuhibAi.
Love you all. ❤️
❤2😁1
1. Which object is the global object in a browser environment?
Anonymous Quiz
32%
A) document
52%
B) window
14%
C) navigator
3%
D) history
❤1👍1
Reached 9k subscribers on YouTube!
We're just getting started! ✊
Subscribe now : https://www.youtube.com/@EmmersiveLearning/
@EmmersiveLearning
We're just getting started! ✊
Subscribe now : https://www.youtube.com/@EmmersiveLearning/
@EmmersiveLearning
❤6👍1
20 Backend Project Ideas🔥
🔹API for a Task Management System
🔹To-Do List API
🔹Blog Platform
🔹Markdown Note-taking App
🔹Online Code Compiler API
🔹E-commerce API
🔹URL Shortening Service
🔹Chat Application Backend
🔹Web Scraper CLI
🔹Online Bookstore
🔹Social Media API
🔹Music Streaming App
🔹Fitness Workout Tracker
🔹Authentication and Authorization Service
🔹File Upload and Management System
🔹Recipe Sharing Platform
🔹Event Booking System
🔹Expense Tracker API
🔹Weather Forecast Service
🔹Online Food Ordering System
@EmmersiveLearning
🔹API for a Task Management System
🔹To-Do List API
🔹Blog Platform
🔹Markdown Note-taking App
🔹Online Code Compiler API
🔹E-commerce API
🔹URL Shortening Service
🔹Chat Application Backend
🔹Web Scraper CLI
🔹Online Bookstore
🔹Social Media API
🔹Music Streaming App
🔹Fitness Workout Tracker
🔹Authentication and Authorization Service
🔹File Upload and Management System
🔹Recipe Sharing Platform
🔹Event Booking System
🔹Expense Tracker API
🔹Weather Forecast Service
🔹Online Food Ordering System
@EmmersiveLearning
👍3❤1👏1
ጎበዝ የ ቲክቶክ ቪድዮ ኢድተር ለዚህ ቻናላችን እፈልጋለሁ!
ከ ሳምፕል ቪድዮ ጋር ከነ ዋጋው በ ውስጥ ይላክልኝ!
ስራው በዩቱብ ቻናላችን የምንለቃቸውን ቪድዮዎች እየቆራረጠ ... ስቶሪይውን የጠበቀ ቢያንስ በቀን አንድ ቪድዮ መስራት የሚችል ነው!
#Remote
Contact : @MehammedTeshome
ከ ሳምፕል ቪድዮ ጋር ከነ ዋጋው በ ውስጥ ይላክልኝ!
ስራው በዩቱብ ቻናላችን የምንለቃቸውን ቪድዮዎች እየቆራረጠ ... ስቶሪይውን የጠበቀ ቢያንስ በቀን አንድ ቪድዮ መስራት የሚችል ነው!
#Remote
Contact : @MehammedTeshome
👍1
Learn Web Storages :
Local Storage
Session Storage
Cookies
https://www.youtube.com/watch?v=zKkKX3GBQTk&list=PLGeDL5FZ9nGbBB6RXURr1ScXv3xwtJu9R&index=14
Local Storage
Session Storage
Cookies
https://www.youtube.com/watch?v=zKkKX3GBQTk&list=PLGeDL5FZ9nGbBB6RXURr1ScXv3xwtJu9R&index=14
YouTube
Cookies, Local Storage, Session Storage || Part - 12 || || Advances Js - Course | #webdev #js
web storage Apis( cookies, Local storage and session storage will be presented in this video)
how can we work on them?
#Bom
let's dive into the video.
This is one of the courses in the Advances Javanoscript Full Course series.
በሁሉም የማህበራዊ ሚድያ ገጾቻችን ይከታተሉን።…
how can we work on them?
#Bom
let's dive into the video.
This is one of the courses in the Advances Javanoscript Full Course series.
በሁሉም የማህበራዊ ሚድያ ገጾቻችን ይከታተሉን።…
❤4