Reply to topic
IE Javascript and HostMySite
rpcarnell


Joined: 07 Dec 2006
Posts: 21
Reply with quote
The script below changes the contents of a select-box when the contents of another selectbox is changed.

The problem is this script works in Internet Explorer in my computer, but it is not working once the page is uploaded in hostmysite.com. The problem applies only to IE.

What's going on? Is it possible that Hostmysite is nto running something in the script?

<script language="javascript1.2" type="text/javascript">
var school_db = new Object( )
school_db["Colegios_y_escuelas"] = [{value:"1", text:"Albrook Flight School Panama"},
{value:"2", text:"Centro Educativo Socrático"},
{value:"3", text:"Colegio Anglo Mexicano"},
{value:"4", text:"Colegio Centro Básico San Carlos"},
{value:"5", text:"Colegio de La Salle"},
{value:"6", text:"Colegio Internacional de Panamá"},
{value:"7", text:"Colegio Internacional Saint George"},
{value:"8", text:"Colegio Internacional SEK"},
{value:"9", text:"Colegio Isaac Rabin"},
{value:"10", text:"Colegio Javier"},
{value:"11", text:"Colegio San Agustín"},
{value:"12", text:"Colegio Socratico"},
{value:"13", text:"Expresiones, Arte, y Creatividad"},
{value:"14", text:"Instituto Alberto Einstein"},
{value:"15", text:"Instituto Latinoamericno de Capacitacion"},
{value:"16", text:"Instituto Panamericano IPA"},
{value:"17", text:"Intec"},
{value:"18", text:"Maria Inmaculada"},

{value:"19", text:"PC-CENTER Corp"},
{value:"20", text:"Reingex Panamá"},
{value:"21", text:"Saint George"},
{value:"22", text:"Solaris English Training Center"},
{value:"23", text:"Otro Colegio o Escuela"}];
school_db["Institutos"] = [{value:"24", text:"Academia de Canto Santa Teresa de Jesus"},
{value:"25", text:"CERPA"},
{value:"26", text:"Centro de Idiomas"},
{value:"27", text:"Centro Pan Usa"},
{value:"28", text:"Cursos de Seguros (Ramo de Vida)"},
{value:"29", text:"Dale Carnegie Training Center"},
{value:"30", text:"ICT"},
{value:"31", text:"INAFORP"},
{value:"32", text:"Instituto de Geociencias, Red Sismologica Nacional"},
{value:"33", text:"Instituto Fleming"},
{value:"34", text:"Instituto Superior de Ciencias y Tecnologías Aeronáuticas"},
{value:"35", text:"New Horizons Panamá"},
{value:"36", text:"Panama2k"},
{value:"37", text:"Tu puedes ser una modelo"},
{value:"38", text:"Otro Instituto"}];
school_db["Universidades"] = [{value:"39", text:"Universidad de Panamá"},
{value:"40", text:"Universidad Interamericana de Panamá"},
{value:"41", text:"Columbus University"},
{value:"42", text:"Florida State University"},
{value:"43", text:"Página Principal de UTP-Cocle"},
{value:"44", text:"ULACIT"},
{value:"45", text:"Universidad De La Salle"},
{value:"46", text:"Universidad de Louisville Panamá"},
{value:"47", text:"Universidad del Istmo"},
{value:"48", text:"Universidad Latina de Panamá"},
{value:"49", text:" Universidad Santa María la Antigua"},
{value:"50", text:"Universidad Tecnológica de Panamá"},
{value:"51", text:"Universidades de América"},
{value:"52", text:"Otra Universidad"}
];




function setCities(chooser) {

var newElem;
var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;


var School_Chooser = document.forms["search_chooser"].elements["escuela"];
while (School_Chooser.options.length) {
School_Chooser.remove(0);
}

var choice = chooser.options[chooser.selectedIndex].value;

var db = school_db[choice];


newElem = document.createElement("option");
newElem.text = "Nombre:";
newElem.value = "";
School_Chooser.add(newElem, where);
if (choice != "") {
for (var i = 0; i < db.length; i++) {
newElem = document.createElement("option");
newElem.text = db[i].text;
newElem.value = db[i].value;
School_Chooser.add(newElem, where);
}
}

}
rpcarnell


Joined: 07 Dec 2006
Posts: 21
Reply with quote
Hostmysite is definitely causing the problem. Each time I run the script in their servers, I get this:

Error: Unterminated String Constant

Why? Because the constants are in Spanish and Spanish has characters like í, ú, ó, which the server or client is translating as o' , etc, and Javascript registers that as open quotes, thus the Unterminated String Constant error I kept getting.

Problem solved, but making a page in Spanish without ó. ú, í, etc will be quite a problem.
IE
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 341
Reply with quote
I'm sorry your having trouble display UTF-8 Spanish characters, but I really don't think it is on HMS's end. Perhaps it is an issue with settings on IE. Sometimes there might be encoding or setting differences on a local page. In the interim, I would reccomend using character codes to represent those characters. My site displays UTF8 content in Chinese and some other languages on certain pages, and I've never had a problem. Do you have a url where I could take a look at this?

Thanks
rpcarnell


Joined: 07 Dec 2006
Posts: 21
Reply with quote
http://www.pilando.com/login.php

Notice how the ? sign appears wherever there's an é or an ñ

Thanks for your help.
Wget
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 341
Reply with quote
Hello,
I downloaded your site in wget, and you are right; it does render question marks. However, I have a shared site of my own which uses UTF-8 characters, and I have never had any troubles. I know that HostMySite shared servers are equipped to render accents etc, and that your content encoding declaration is correct. Is it possible that say your FTP client is having trouble with these characters? Obviously some piece of software between the copy on your computer and the rendering is replacing the question marks. Have you contacted HMS support regarding this yet? I know this is frustrating, and you as (i'm guessing the web designer) must be pretty frustrated about letting down your client. I've never had any problems with this sort of thing, so I don't want to blame HMS, especially since they are a great host, and have taken these things into account before. I'd recommend calling them, and they can probably give you some advice. If it is the case that the server doesn't support this, they definitely have servers that do. I know that some mail servers don't always support funky charsets such as Japanese and Thai, and they have special mail servers for that, but web is a different story. Tell me how things are going.

thanks.
rpcarnell


Joined: 07 Dec 2006
Posts: 21
Reply with quote
Yes, the problem is not hostmysite (pretty dumb of me to jump to that conclusion, but hostmysite is the only web hosting company I have used for the last two years), but Dreamweaver. I wrote everything from the Code area instead of using Design. I never did that before, but now that I am better at html and PHP, I did.

In Code "contreseña" becomes "Contrase?a" once uploaded. If you write that word in Design, it becomes contrase&ntilde;a and any browser can show it to the user as "contraseña". Just an example of what was causing the problem.

Thanks for your help.
Resolution
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 341
Reply with quote
Hello,
I'm glad you solved this problem. I checked your website, and the unicode characters are rendering perfectly. I definitely understand why you thought that the problem was on the server side, because some hosts have internationalization problems, although HostMySite definitely does not. Dreamweaver does seem to have a habit of being quite quirky, such as placing layer divs without nesting when they appear to be nested. Dreamweaver also, like you said, has problems with compatibility between code and design view. I personally only use Dreamweaver for the original layout, and use Textmate for the rest.
IE Javascript and HostMySite
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic