[1. Ordinary pop-up window]
works on some older browsers. In these old browsers, the code in the tag will not be displayed as text
Come out. You can use either single quotes or double quotes, just don't mix them.
【2. Pop-up window after setting】
Parameter explanation:
End of js script
【 3. Use functions to control pop-up windows]
The following is a complete code.
.....
A function openwin() is defined here, how to call it?
Method 1:
A window pops up when the browser reads the page;
Method 2:
A window pops up when the browser leaves the page;
Method 3: Call with a link: Method 4: Call with button:
[4. Pop up 2 windows at the same time]
Slightly change the source code:
To avoid pop-up The two windows are covered. Use top and left to control the pop-up position so that they do not cover each other. Finally, use the four methods mentioned above
to call it. Note: The names of the two windows (newwindows and newwindow2) should not be the same, or they should all be empty.
[5. The main window opens the file 1.htm, and the small window page.html pops up at the same time]
The following code is added to the main window
area:
Join the
area:
open
.
[6. Timing closing control of pop-up windows]
Now let’s control the pop-up windows, and the effect will be better. If we add a small piece of code to the pop-up page (
note that it is added to the HTML of page.html, not the main page, otherwise...), let it close automatically after 10 seconds, right? Cooler?
First, add the following code to the
area of the page.html file:
Then, use the sentence [7. In the pop-up Add a close button to the window]
[8. Pop-up window included - two windows on one page]
Through the following example, you can complete the above effect in one page.
>
Look at the code in OpenWindow.document.write(). Isn’t it standard HTML? Just write more lines according to the format
. Be sure to note that an error will occur if there is one more label or one less label. Remember to end it with OpenWindow.document.close().
[9. Cookie Control of Pop-up Window]
Recall that although the above pop-up window is cool, it has a little problem. For example, if you put the above script in a page that needs to be visited frequently (such as the homepage), then every time you refresh the page, the window will pop up. Isn't it very annoying? :-(
Solution:
We can use cookies to control it. First, add the following code to the
area of the main page HTML:
Then, replace the original sentence
in the main page with (note it is not openwin but loadpop!). You can try refreshing the page or re-entering it. Pages and windows will never pop up again. The real
Pop-Only-Once!
At this point, the production and application skills of pop-up windows are basically completed.
1.弹启一个全屏窗口
;
[url]www.e3i5.com[/url]
2.弹启一个被F11化后的窗口
;
[url]www.e3i5.com[/url]
3.弹启一个带有收藏链接工具栏的窗口
('http://www.pconline.com.cn','example03','width=400,height=300,directories');>
[url]www.e3i5.com[/url]
4.网页对话框
<script> <BR><!-- <BR>showModalDialog <br><br>('http://www.pconline.com.cn','example04','dialogWidth:400px;dialogHeight:300px; <BR>dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes') <BR>//--> <BR></script>
[url]www.e3i5.com[/url]
<script> <BR><!-- <BR>showModelessDialog <br><br>('http://www.pconline.com.cn','example05','dialogWidth:400px;dialogHeight:300px; <BR>dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes') <BR>//--> <BR></script>
target=_blank>[url]http://www.pconline.com.cn[/url]
showModalDialog()与showModelessDialog()的区别,在于showModalDialog()打开模式窗口,
showModelessDialog()打开无模式窗口。
dialogHeight: iHeight 设置对话框窗口的高度。
dialogWidth: iWidth 设置对话框窗口的宽度。
dialogLeft: iXPos 设置对话框窗口相对于桌面左上角的left位置。
dialogTop: iYPos 设置对话框窗口相对于桌面左上角的top位置。
center: {yes no 1 0 } 指定是否将对话框在桌面上居中,默认值是“yes”。
help: {yes no 1 0 } 指定对话框窗口中是否显示上下文敏感的帮助图标。默认值是“yes”。
resizable: {yes no 1 0 } 指定是否对话框窗口大小可变。默认值是“no”。
status: {yes no 1 0 } 指定对话框窗口是否显示状态栏。对于非模式对话框窗口,默认值是“yes”;
对于模式对话框窗口,默认值是 “no”。
网页经典代码
1. 将彻底屏蔽鼠标右键,无右键菜单
也可以用于网页中Table框架中
no |
2.取消选取、防止复制
3.不准粘贴
4.防止复制
5.IE地址栏前换成自己的图标
说明:关于favicon.ico文件的制作。你可以先在FW中做一个图片,属于你自己站点一个小图标。然后在
ACD see将文件属性改为*.ico,然后将你做的*.ICO文件传到你的服务器目录中,然后就可以使用以上代
码来实现,当别人登陆你的站点时,地址栏里使用的就是你自定义的图标了。
6.可以在收藏夹中显示出你的图标
说明:制作方法和上面的一样。只是显示的方式不同,这个是在别人收藏你的网页地址时显示的个性图
标。
7.关闭输入法
说明:这段代码是在表格提交时用到的。也就是在输入数据时不可以使用其他输入法模式。
8.永远都会带着框架
<script><!-- <BR> if (window == top)top.location.href = frames.htm;// --></script>
说明:frames.htm为你的网页,这也是保护页面的一种方法
9.防止被人frame
<script><!-- <BR> if (top.location != self.location)top.location=self.location; <BR>// --></script>
10.网页将不能被另存为
说明:
11.查源文件
onclick=window.location = 'view-source:'+ target=_blank>[url]http://bbs.055.cn/test.htm
[/url]';>
12.COOKIE脚本记录,有很大的用处哦
function get_cookie(Name) {
var search = Name + =
var returnvalue = ;
if (documents.cookie.length > 0) {
offset = documents.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = documents.cookie.indexOf(;, offset);
// set index of end of cookie value
if (end == -1)
end = documents.cookie.length;
returnvalue=unescape(documents.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadpopup(){
if (get_cookie('popped')==''){
openpopup()
documents.cookie=popped=yes
}
}
说明:以上是JS代码,请自己加起始符和结束符
13.内框架

JavaScript's application in the real world includes front-end and back-end development. 1) Display front-end applications by building a TODO list application, involving DOM operations and event processing. 2) Build RESTfulAPI through Node.js and Express to demonstrate back-end applications.

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

JavaScript's applications in the real world include server-side programming, mobile application development and Internet of Things control: 1. Server-side programming is realized through Node.js, suitable for high concurrent request processing. 2. Mobile application development is carried out through ReactNative and supports cross-platform deployment. 3. Used for IoT device control through Johnny-Five library, suitable for hardware interaction.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment