navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Rotating Quote Javascript and Accents in Spanish Words

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Rotating Quote Javascript and Accents in Spanish Words
Page: [1]
 
Jordan

 

Posts: 117
Joined: 1/8/2002
From: Maine
Status: offline

 
Rotating Quote Javascript and Accents in Spanish Words - 6/16/2008 10:20:48   
I've been working on preparing a Spanish version of my employers company Web site. I don't speak Spanish, so it has been translated for me. I've changed the encoding so the site will show the accents that appear in many Spanish words. The one problem that I have not been able to figure out is a javascript that I'm using to randomly rotate quotes throughout the site. I get that odd little "?" symbol where a letter with an accent should appear. I've tried inserting "\" before the letter as you do for apostrophes and quotation marks, but that didn't do the trick. Here's an example of the script...

This in the head of my document...
quote:

<script language="JavaScript1.1" src="includes/quotes.js">


This in the quotes.js file....
quote:

var quotes=new Array()

quotes[0]='La mezcla única dulce cítrica de las variedades de Arándanos Silvestres entrega un torrente de sabor delicioso de la Madre Naturaleza que no se puede encontrar en ningún otro lugar. Esto significa que sus productos de Arándanos Silvestres tendrán más del gran sabor que sus clientes desean. '

var whichquote=Math.floor(Math.random()*(quotes.length))
document.write(quotes[whichquote])


Surely javascript is used in Spanish Web sites. What am I missing?
Thanks!

_____________________________

Mane

 

Posts: 103
Joined: 7/7/2005
Status: offline

 
RE: Rotating Quote Javascript and Accents in Spanish Words - 6/16/2008 10:57:38   
Have you tried using HTML entities? For example for ¿, the upside down question mark, put &iquest; into the source code.

(in reply to Jordan)
Tailslide

 

Posts: 6046
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Rotating Quote Javascript and Accents in Spanish Words - 6/16/2008 10:57:56   
You'll probably need to switch to UTF-8 from whatever you're using - so try replacing the current character set meta tag with this:

<meta http-equiv=content-type content="text/html; charset=utf-8">


_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Jordan)
Jordan

 

Posts: 117
Joined: 1/8/2002
From: Maine
Status: offline

 
RE: Rotating Quote Javascript and Accents in Spanish Words - 6/16/2008 11:22:48   
Yes! Changing the character set worked. Thank you!

(in reply to Tailslide)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Rotating Quote Javascript and Accents in Spanish Words
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts