Home > Web Front-end > JS Tutorial > Use IE's address bar to assist in debugging web page scripts_javascript skills

Use IE's address bar to assist in debugging web page scripts_javascript skills

WBOY
Release: 2016-05-16 19:17:42
Original
1279 people have browsed it

I accidentally used Shift Left Click to click on a hyperlink whose link target (href) was a script. As a result, a dialog box for whether to debug the script appeared. Clicking yes can actually open the debugging script, but where does this script come from?
Use IE's address bar to assist in debugging web page scripts_javascript skills
Looking back at the newly opened IE, the address bar said: javascript:open(url). It turns out that the address bar of IE can use the "JavaScript:" statement to execute scripts. Now I try JavaScript:alert('ok'), and it works fine!

It’s a fun feature, let’s write some more complex scripts: javascript: var s=''; for( var i=0; i http://www.google.com, enter in the address bar: javascript: document.getElementsByTagName('Input')[1 ].disabled = true; alert('');, what will you see? Can't you enter the query keyword?

In fact, the scope of the script running in the address bar is the script scope of the current page. Using this feature, we can not only simply execute script statements, but also assist us in debugging scripts. For example, I want to view the values ​​of some variables, and we do not need to enter complex debugging mode. The picture below is my debugging popup menu<.> is an example. This method can avoid writing status=... everywhere when debugging code.
Use IE's address bar to assist in debugging web page scripts_javascript skills Here we can not only write JavaScript: in the address bar, but also write vbscirpt: alert("ok!"), ecmascript: and jscirpt. However, ecmascript will be automatically converted to javascirpt, and jscript will be converted to vbscript. Although this feature is simple, I hope everyone can play it. And play more tricks.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template