Saturday February 22, 2025
Home
|
Contact
|
Support
|
JavaScript... so much power in such a few lines of code..
<<
Random Page
Programming
C/C++
C# (with .net)
Win32/Win64
RegEx
Markdown (.md)
Python (.py)
Batch (.bat)
Programming XBOX & 360
XDK Tuts
NonXDK Tuts
OpenXDK Tuts
XNA with C#
Tutorials
Win32/Win64
DirectX3D (DirectX)
Maths of 3D
ASM..10101
Java
Physics
Visual Studio
Vulkan
Graphics
LaTeX
Data Mining & Machine Learning
AI
Fractals
Dual-Quaternions
Shaders
Vertex & Pixel Asm
Cg
Effect Files (.fx)
GLSL (.glsl)
WGSL (.wgsl)
Executable File Formats
PE (.exe) Inside Out
XBOX (.xbe) Format
Android (.apk)
3D File Formats
Quake2 (.md2) Format
Quake3 (.md3) Format
Quake3 BSP (.bsp)
3DS Format (.3ds)
X DirectX (.x)
GLTF (.glTF/.glb)
...
Image Formats
Bitmap (.bmp)
JPEG (.jpg)
DirectX DDS
Flash SWF
PNG (.png)
GIF (.gif)
WebP (.webp)
...
Internet Programming
WinSock
PHP
JavaScript
WebGL
WebXR
Retro Games
WebGPU
WebNN
Projects
Misc Demos
Notebook
Pixels
TexLive (LaTeX)
Crosswords
eNotes
Media
Quotes
Evolve
HSK
Slides
Trending
WordSearch
Links
Recommended Books
Donations (PayPal)
Contact
Books
Amazon
JavaScript...
so much power in such a few lines of code..
One Window Closes A New Window Opens (Never Ending Windows)
This little trick uses the
beforeunload
event - to open a new window right before the current window is closed.
window
.
onbeforeunload
= function() {
window
.
open
(
"https://www.xbdev.net"
,
"_blank"
);
// Replace with the URL you want to open
return
null
;
};
Of course, the browser security settings may prevent this script from working, as modern browsers often
block pop-up windows
to improve user experience and security.
Advert (Support Website)
Visitor:
Copyright (c) 2002-2025 xbdev.net - All rights reserved.
Designated articles, tutorials and software are the property of their respective owners.