javascript

check if javascript is enabled and display a message if it is not using an asp custom control

Hi, I'm using Javascript, ASP.net and c#. I want to write a custom control to check if javascript is enabled on the browser and display a message. I'm using the following approach: -the control shows a message "Javascript disable" in a tag -the control adds in the section a javascript section with this line: window.onload = function()...

Is there any window management library in JavaScript?

I have many browser windows, opened from JavaScript. And I want to manage them - place cascade, tile and resize them all at the same time. Are there any libraries that can help me? ...

Object comparison in JavaScript

What is the best way to compare Objects in JavaScript? Example: var user1 = {name : "nerd", org: "dev"}; var user2 = {name : "nerd", org: "dev"}; var eq = user1 == user2; alert(eq); // gives false I know that "Two objects are equal if they refer to the exact same Object", but is there a way to check it another way?? Using this way w...

innerHTML in javaScript for Internet Explorer

Hi, I have used innerHtml in my java based web application. JavaScript works fine with Mozilla Firefox but it is not working in InternetExplorer. Could you please tell me how to make it work in Internet Explorer too. or what is substitute of innerHTML in IE. Code is: function show() { if('number' == typeof this.rowIndex) { ...

Making 'custom colour dialog' in Firefox

Hello, I am making a Firefox extension and would like to give my users more control over the look and feel of things. In my extension's preference pane, I would like to achieve something close to this:- CodeProject: Custom Color Dialog Box I know I can achieve this by making lots of different divs for as many colours as possible and ad...

Reloading in javascript

I have a facebook game application that is released at facebook platform at the following link : FaceBookGameApplication and i am using iframe and the problem now that after answering the question in the game i reload the page from javascript code : window.location.href = sURL; and on posting back i am updatting 2 divs of the score a...

How to include different Javascript files depending on build configuration?

Is there a way to include a different Javascript file in an ASP.NET page depending whether it's a debug or release build? For release builds, I want to include the minified (using yuicompressor) Javascript, but I would like to use the more readable file for debug and development. ...

Calling jQuery Function with Javascript Function

Having some trouble getting this to work, specifically with $.getJSON(). I want to wrap the getJSON function from jQuery in a Javascript function like so: function reload_data() { $.getJSON("data/source", function(data) { $.d = data; }); } But when I call reload_data() it doesn't execute the jQuery function inside. Any...

How to wait for document to finish loading in javascript when i am inside an event that occurs before

Hi I am using JQuery Address plugin for address.change event the problem is that this event occurs before document is fully loaded ( in FireFox & safari ) how can I wait for it to load? thanks. ...

JS 1-2k variables make page load slow

On one page of my website the user has the ability to choose and remove up to 2000 items through selecting multiple string representations of them in a dropdown list. On page load, the objects are loaded onto the page from a previous session into 7 different drop-down lists. In the window.onload event, the function looping through the ...

How to get my submenus to disppear after a certain period using javascript?

I want to set time for my submenus to disppear after a certain period using javascript..my code is: function buildsubmenus(){ for (var i=0; i<menuids.length; i++){ var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul") for (var t=0; t<ultags.length; t++){ ultags[t].parentNode.getElemen...

How to implement AJAX data collection properly?

I'm currently implementing a small application driven by a YUI DataTable. For this DataTable I need two configuration arrays, which I both get from server with an XHR. However, my current implementation makes me wonder how these things are done properly. What I have now is two asynchronous AJAX requests which both set their respective d...

Sending JavaScript Array to .ashx for handling

I need to send a JavaScript array via querystring to my .ashx. In my .ashx (handler) I'll have a method that will need to parse through each value in the array and populate a generic List Just trying to think about the way to go about this both passing it to the querystring as well as how to take that querystring value and convert it t...

JQuery's appendTo is very slow!

I have a html table that I reorder based on a CSV list of custom attribute values that I have for each table row. I am using the following function to do it: for (var i = 0; i < arrCSV.length; i++) { $('#' + tableId) .find('[fname = ' + arrCSV[i] + ']') .eq(0) .parents('tr') .eq(0) .appendTo('#' + tableId...

How to focus child window after parent window refresh

I am opening a popup window containing a flash movie using JavaScript. The popup contains a media player that uses SoundManager2. Users add files to the media player from the parent window. However, when reloading the parent window, the reference to the child window (media player) is lost. So, to bring focus to the media player, we curre...

Sorting javascript by property value

If I have a javascript object such as: var list = { 'you': 100, 'me': 75, 'foo': 116, 'bar: 15}; is there a way to sort the properties based on value? So that I end up with list = { 'bar':15, 'me': 75, 'you': 100, 'foo': 116 }; I'm having a real brain-dead moment regarding this. ...

Google Maps - Same text appears in info window when using multiple markers

Hi everyone, I'm having an issue with multiple markers on google maps - I currently have a MySQL database storing info (location info). In php I then extract this info and loop through each postcode to dynamically create the required javascript to place a marker for each place in my database. This works successfully so I know that I'...

Force page refresh and jump to a #section

It seems that I must be missing something completely elementary. What I’m trying to achieve looks like quite a common case, and so it makes me wonder why there is no straightforward way. The problem is that I would like to refresh the current page from JavaScript and simultaneously land on a #section. If I do simply: document.location....

Advanced JavaScript Interview Questions

I have an interview coming up for a JavaScript Engineer position that I expect will be on advanced JavaScript topics. I'm sure there will be questions on closures, but other than that what kinds of topics and questions should I expect? ...

Pop-Up Window on Parent Window from iFrame Button

Hi, If I have a button within a iframe, how can I create a pop-up window that will appear as part of the parent window and not within the iframe window, when I press on this button, within the iframe? Thanks. Tony. ...