reading in utf-8 file (javascript XMLHttpRequest) gives bad european characters

Tags: , , ,


can anyone help? I have small procedure to read in an UTF-8 file with javascript using XMLHttpRequest.. this file has european characters like miércoles sábado etc.. Notice the accents.. But when …

Generic way to detect if html form is edited

Tags: , ,


I have a tabbed html form. Upon navigating from one tab to the other, the current tab’s data is persisted (on the DB) even if there is no change to the data. I would like to make the persistence call …

JavaScript chop/slice/trim off last character in string

Tags: , ,


I have a string, 12345.00, and I would like it to return 12345.0. I have looked at trim, but it looks like it is only trimming whitespace and slice which I don’t see how this would work. Any …

Tags:

How do I include a JavaScript file in another JavaScript file?


Is there something in JavaScript similar to @import in CSS that allows you to include a JavaScript file inside another JavaScript file?

Get current URL from IFRAME

Tags: , ,


Is there a simple way to get the current URL from an iframe? The viewer would going through multiple sites. I’m guessing I would be using something in javascript.

Tags:

“Please wait” image on every user action with ASP.NET 3.5


In our ASP.NET 3.5 application, we would like to implement a “Please wait..” feature : on every user action (button click, tab change, etc.) we would display a little spinner on top of the …

When serving JavaScript files, is it better to use the application/javascript or application/x-javascript

Tags: , ,


The whole question fits in the title. And to add some context: I’m not asking what is the best according to what the specs are saying, but rather what works the best given the mix of browsers deployed …

Why can I add named properties to an array as if it were an object?

Tags: , , ,


The following two different code snippets seem equivalent to me: var myArray = Array(); myArray[‘A’] = “Athens”; myArray[‘B’] = “Berlin”; and var myObject = {‘A’: ‘Athens’, ‘B’:’Berlin’}; because …

Is there a way to select sibling nodes?

Tags: , ,


For some performance reasons, I am trying to find a way to select only sibling nodes of the selected node. For example,

Tags:

Get all non-unique values (i.e.: duplicate/more than one occurrence) in an array


I need to check a JavaScript array to see if there are any duplicate values. What’s the easiest way to do this? I just need to find what the duplicated values are – I don’t actually need their indexes …