FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/javascript/ql/src/DOM/Alert.qhelp at codeql-cli/v2.19.2 · github/codeql · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github
/
codeql
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10k
Code
Issues
997
Pull requests
467
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
javascript
/
ql
/
src
/
DOM
/
Alert.qhelp
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (34 loc) · 1.29 KB
Breadcrumbs
codeql
/
javascript
/
ql
/
src
/
DOM
/
Alert.qhelp
Copy path
File metadata and controls
45 lines (34 loc) · 1.29 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!
DOCTYPE
qhelp
PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<
qhelp
>
<
overview
>
<
p
>
Using the <
code
>alert</
code
> function to show a message to the user is disruptive, since an alert
dialog prevents the user from accessing the rest of the program's interface until the dialog is
closed. Also, alert dialogs are displayed by the browser and hence cannot be styled to fit with
the rest of the web application, which negatively affects user experience.
</
p
>
<
p
>
Some developers use <
code
>alert</
code
> during debugging, so left over calls to <
code
>alert</
code
>
may also indicate unfinished code.
</
p
>
</
overview
>
<
recommendation
>
<
p
>
Use one of the HTML-based dialog box widgets offered by frameworks such as
<
a
href
=
"
http://jqueryui.com
"
>jQuery UI</
a
>, and consider using a non-modal dialog box where possible.
</
p
>
</
recommendation
>
<
example
>
<
p
>
The following code snippet uses <
code
>alert</
code
> to print a warning message if an element of a form is not
correctly filled in. A preferable option would be to visually highlight the corresponding field to provide
more context for the warning.
</
p
>
<
sample
src
=
"
examples/Alert.js
"
/>
</
example
>
<
references
>
<
li
>Mozilla Developer Network: <
a
href
=
"
https://developer.mozilla.org/en-US/docs/Web/API/Window.alert
"
>Window.alert</
a
>.</
li
>
</
references
>
</
qhelp
>
Back
|
FazBrowse Home
|
New Git URL