Over a million developers have joined DZone.

How To Display Alert

A JavaScript alert is a simple window containing a message.

Here is what the code looks like — it's just one line (inside the JavaScript tag):

The text inside the parentheses is what is shown in the alert message. If you want to show a string of literal text, enclose the text in quotes. To display variable values, enter the variable name without quotes. You can also combine variable values and text strings by using the + sign. For example:

function showAlert() {
	var country = "Fiji";
	var city = "Suva";
	alert('The city of ' + city + ' is located in ' + country + '.');

Spring Framework

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}