Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

External Javascript and Spanish Characters

Status
Not open for further replies.

dbldutch21

Programmer
Aug 12, 2007
3
If I have the following setup

HTML FILE
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] lang="es" xml:lang="es">
	<head>
		<title>Javascript Test</title>
		<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
		<script type="text/javascript" src="default.js"></script>
	</head>
	<body>
		Test
	</body>
</html>

JAVASCRIPT FILE - default.js
Code:
alert('Esto no está trabajando');

The Spanish characters in the alert show up as boxes. Does anyone know how to fix this?

Thank you.
 
Awesome, thanks. I went with the character set option.

<script type="text/javascript" src="default.js" charset="iso-8859-1"></script>

That worked perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top