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 …

How do I programmatically click on an element in JavaScript?

Tags: , , , ,


In IE, I can just call element.click() from JavaScript – how do I accomplish the same task in Firefox? Ideally I’d like to have some JavaScript that would work equally well cross-browser, but if …

Javascript – getting path of file dropped into HTA

Tags: , , ,


I am building a little HTA for personal use, and would like to be able to drag and drop a file to the interface. Once the file is dropped, I would either automatically run it (assuming it fits some …

Parse and add url from clipboard

Tags: , , , ,


I need a javascript bookmark to take the url I have in the clipboard parse out the 2 numbers and create a new url, and add a link to the top of the page, that when clicked adds the url to my bookmark …

How do I correctly clone a JavaScript object?

Tags: , ,


I have an object x. I’d like to copy it as object y, such that changes to y do not modify x. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted properties. This isn’t a problem, since I’m copying one of my own literal-constructed objects. How do I correctly clone a JavaScript object? Answer To do this for any object in JavaScript will not be simple or straightforward. You will run into the problem of erroneously picking up attributes from the object’s prototype that should be left in the prototype and not copied to