{"flag":true,"single":true,"pageTitle":"BOM In javascript","post":{"id":210,"user_id":"1","slug":"bom-in-javascript-foyu","title":"BOM In javascript","body":"<p><strong>window.document.getElementById(\"header\"); \/\/SAME AS<\/strong><\/p>\r\n<p><strong>document.getElementById(\"header\");<\/strong><\/p>\r\n<ul>\r\n<li>window.innerHeight<\/li>\r\n<li>window.innerWidth<\/li>\r\n<li>window.open() - open a new window<\/li>\r\n<li>window.close() - close the current window<\/li>\r\n<li>window.moveTo() - move the current window<\/li>\r\n<li>window.resizeTo() - resize the current window<\/li>\r\n<li>screen.width<\/li>\r\n<li>screen.height<\/li>\r\n<li>screen.availWidth \/\/withoaut taskbar etc<\/li>\r\n<li>screen.availHeight<\/li>\r\n<li>screen.colorDepth<\/li>\r\n<li>screen.pixelDepth<\/li>\r\n<li>window.location.href \/\/href (URL) of the current page<\/li>\r\n<li>window.location.hostname \/\/domain name of the web host<\/li>\r\n<li>window.location.pathname \/\/ path and filename of the current page<\/li>\r\n<li>window.location.protocol \/\/web protocol used (http: or https:)<\/li>\r\n<li>window.location.assign(\"https:\/\/www.google.com\") \/\/loads a new document<\/li>\r\n<li>window.history.back(); \/\/same work as click on back button in browser<\/li>\r\n<li>history.forward() \/\/foward button<\/li>\r\n<li>window.navigator: info about visitor's browser.<\/li>\r\n<li>navigator.appName; \/\/Netscape<\/li>\r\n<li>navigator.appCodeName; \/\/Mozilla<\/li>\r\n<li>navigator.platform; \/\/Win32<\/li>\r\n<li>navigator.cookieEnabled; \/\/true if cookies enabled<\/li>\r\n<li>navigator.onLine; \/\/true or false<\/li>\r\n<\/ul>\r\n<p><strong>ALERTS:<\/strong><\/p>\r\n<ul>\r\n<li>window.alert(\"sometext\");<\/li>\r\n<li>window.confirm(\"sometext\"); \/\/if click ok return true, else if click cancel return false<\/li>\r\n<li>window.prompt(\"sometext\",\"defaultText\"); \/\/for input some text<\/li>\r\n<\/ul>\r\n<p><strong>TIMING:<\/strong><\/p>\r\n<p>window.setInterval(function, milliseconds);<strong>\/\/repeats execution of function after milliseconds<\/strong><\/p>\r\n<p>window.setTimeout(function, milliseconds); <strong>\/\/execute function after milliseconds only one time<\/strong><\/p>\r\n<p>clearTimeout(myVar);&nbsp; <strong>\/\/if we want to cancel execution of setTimeout<\/strong><\/p>\r\n<p>&nbsp;<\/p>\r\n<p>Browser Object Model (BOM) allows JavaScript to \"talk to\" the browser.<\/p>\r\n<p>All global JavaScript objects, functions, and variables automatically become members of the window object.<\/p>\r\n<p>BOM USED TO<\/p>\r\n<p>open\/close windows,get screen info ie width,get locations,alerts,timings&nbsp;<\/p>","category_id":"12","is_private":"0","created_at":"2023-10-13T01:39:01.000000Z","updated_at":"2023-10-13T01:39:01.000000Z","category":{"id":12,"user_id":"1","name":"Javascript","slug":"javascript-xplw","parent_id":null,"created_at":"2023-03-23T02:24:43.000000Z","updated_at":"2023-03-23T02:24:43.000000Z"},"user":{"id":1,"name":"R GONDAL","email":"rizikmw@gmail.com","email_verified_at":null,"two_factor_confirmed_at":null,"current_team_id":"1","profile_photo_path":null,"created_at":"2023-03-12T10:49:33.000000Z","updated_at":"2025-01-10T12:59:00.000000Z","profile_photo_url":"https:\/\/ui-avatars.com\/api\/?name=R+G&color=7F9CF5&background=EBF4FF"}},"pageDesc":"window.document.getElementById(\"header\"); \/\/SAME AS document.getElementById(\"header\");  window.innerHeight window.innerWidth window.open() - - BOM In javascript (Updated: October 13, 2023) - Read more about BOM In javascript at my programming site [SITE]","categories":[]}