-
Content Count
5 -
Joined
-
Last Visited
A long, long time ago...
Community Reputation
0 Clean SlateAbout whatabrain
-
Rank
Freshman
-
This site has a ton of JavaScript errors!
whatabrain replied to whatabrain's topic in Simtropolis Related
it is perfectly acceptable to leave a single quotation mark within an expression provided that expression is enclosed within double quotes.quote> You're right, of course. However, since this is in an HTML attribute, either the single or double quotes have to be escaped. I find that the easiest and least bug-prone method is to always escape single quotes, double quotes and backslashes in generated JavaScript strings. While not absolutely necessary, it prevents problems when you later decide to change the style of quoting you use. In this case, we have a single-quoted string which contains single-quotes. That's what causes the problem. It is a well known fact that IE6 is very very very buggy with regard to some of it's code handlingquote> Not sure where you're getting this. I've also been coding in JavaScript for quite a few years, and I've found that while IE has some problems (rendering and DOM manipulation speed are its biggest), it's the least buggy browser out there. People brag about how well Mozilla conforms to the specs, but from what I've seen, all versions of Mozilla, Netscape and FireFox have some serious bugs when it comes to more complex DOM manipulation, and due to those bugs, conform less well than IE. Safari is much worse than Mozilla. IE 5.0 had a lot of problems, but they've cleaned them up for 6.0. I couldn't login, so, I went to www.java.com/getjava/ and updated my Java software automatically, and after restarting the PC, I could log in without a single error. What about that? quote> Sounds like your Java installation automatically turned off the setting which allows JavaScript errors to pop up. It didn't fix the problem -- just hid it. If no, and you are just "picking at the coding because you have nothing better to do", I simply suggest you remember this site is provided for free.quote> I'm picking at the coding because I find JavaScript errors annoying. However, I'm not just picking at it. As you can see in my posts, I've also identified the offending lines of code and offered simple solutions to the problems. I wasn't aware that contacting the site's creator was the way to get these kinds of things fixed. I figured this forum was the way to do it, and would be less annoying to him. However, I'd be happy to write up some quick bug fixes for the site if he's interested. -
This site has a ton of JavaScript errors!
whatabrain replied to whatabrain's topic in Simtropolis Related
Just found another error, on the "Modds" page. The following code is incorrect: escape('<strong>Trolca's Street Modd</strong> by Trolca (13,364 downloads)') The single-quote in "Trolca's" should be escaped: escape('<strong>Trolca\'s Street Modd</strong> by Trolca (13,364 downloads)') In general, when generating JavaScript code like this, care should be taken to escape quotes and backslashes. If you're using perl, php, or any other language that supports regular expressions, the following expression will correct embedded JavaScript: s/([\'\"\\])/\\$1/g; -
This site has a ton of JavaScript errors!
whatabrain replied to whatabrain's topic in Simtropolis Related
This has nothing to do with Java. This is JavaScript, which is a totally different thing, dispite the name. Here's why you don't see the errors: Knowing that bad JavaScript code can be found on all sorts of web sites, browsers hide JavaScript errors by default. Since I write JavaScript code, I want to know when errors occur. They always indicate that something's not working. So in my IE "advanced" settings, I check the box that says "Display a notification about every script error." In FireFox and other Mozilla-based browsers, I open the JavaScript console. Now if you're using IE, and you hover your mouse over the "log-in" region, you may notice that the icon on the left side of your status bar changes to an error icon. Double-clicking on the icon will show you the JavaScript error that your settings hid. -
This site has a ton of JavaScript errors!
whatabrain replied to whatabrain's topic in Simtropolis Related
I wasn't referring to pop-up ads. In Internet Explorer, if you enable javascript errors, you get a pop-up message for each error. The problem is simple: The sign-in region on the home page has an onmouseover event which calls ftcontexthelp(). This function doesn't exist in the HTML. I assume it's defined in "wz_tooltip.js" (which, by the way, is included twice). When I tried to access that file directly, it didn't exist. So every time you move your mouse over the sign-in area, you get a JavaScript error. -
This site has a truly ridiculous number of JavaScript errors. I ran into ten or so error pop-ups on the home page and during the regisration and sign-in process. The developers should enable JavaScript error reporting in their browsers and run through the site. These errors are usually very easy to fix. Edit: Just to clear things up for new readers of this post, the error occurs when you hover your mouse over the log-in area. It's caused by a JavaScript function not existing in the scope of the page. And I'm not referring to pop-up ads. These are JavaScript errors, which pop up in MS Internet Explorer when your settings are configured the right way.
