javascript

Mozilla Prism: disable pop-up blocker

I'm developing an application using Mozilla Prism. Unfortunately, Prism has its pop-up blocker activated. I tried to disable it by inserting a line like user_pref("privacy.popups.policy", "1"); or user_pref("dom.disable_open_during_load", false); into the webapp.js, which resides in the directory of the Prism application. Ho...

What's wrong with var x = new Array();

In JSLint, it warns that var x = new Array(); (That's not a real variable name) should be var result = []; What is wrong with the 1st syntax? What's the reasoning behind the suggestion? ...

Tell swf to check what page its loading on an switch to the correct page.

Google has indexed my .swf file, so it’s loading by itself in a browser ( example.com/FL_map_page.swf ) I need for the .swf to check to see if it is loaded on the .html page and if not switch to the correct page. ...

How might I perform conditional replacement using JavaScript's RegExp?

I am trying to wrap my head around using regular expressions and replace() with JavaScript, but have not yet been successful Suppose I have a string containing this: <img alt="a picture of ..." src="image/1533?foo=1&bar=2$zot=3" width="500" /> If zot=3 I want remove foo (and its value) (or replace foo=x with an empty string). The re...

jQuery if statement, syntax

Hey, I'm a little confused about a simple jQuery statement... I want the operation to proceed only if A and B are true. If A isn't true, stop. If A and B are true, then continue. Thanks! ...

How can I execute Javascript function before Page load?

Hi, I am using a hidden field 'Isjsenabled' to detect whether Client's Javascript is enabled or disabled. If Javascript is enabled, Javascript function will be fired and it will set hidden field's value to 1. I want to check the hidden value from server side Page_load. But the problem is Javascript gets fired after Page load. Do you ...

How relevant is the OpenAjax Alliance to the average web developer?

The OpenAjax Alliance states that it is an "organization of leading vendors, open source projects, and companies using Ajax," but I don't find any questions on stackoverflow that reference them. I am wondering if it is important to the practicing web developer. John Resig has a Thoughts on OpenAjax blog post in Feb 2007, but I can't fi...

Linking JavaScript Libraries in User Controls

I have been using ASP.NET MVC for six months or so and have been checking out the Nerd Dinner example created by those Microsoft guys. One thing I noticed they did when enabling AJAX to RSVP for a dinner, is put the JavaScript references in the User Control being used for RSVPing. (FILE: RSVPStatus.ascx) <%@ Control Language="C#" In...

Has anyone used Sigma Grid (Javascript-based editable data grid)?

Has anyone here used Sigma Grid for JavaScript-based data grids? It was the only grid I could find that would allow fast data entry and use of the keypad, but before we spend a lot of development time I wanted to learn about the community's experience with it. (Note: we need dozens of fast, sortable, and editable grids that can be use...

How might I determine the XPath of a DOM element?

In JavaScript, supposing I have a reference to an element, how do I retrieve an XPath expression that would select it? Is there something like objElement.xpath? ...

MS excel like functionality in web ui with more complexity?

I have swing application in which there is MS excel like functionality. User can enter data in the columns. Most of the columns are drop down lists, so use have to select from the list. Can this functionality be easily built in Adobe Flex or GWT? Second complexity is depending upon what value is selected in a column, another column sho...

printing a table in rails

Hi is there a way to print only a table in rails view which have two div's and a table is in another div and the print image is in another div, and print the table overflow contents, cause when i am using window.print(); it print the whole page and also the images and leave the overflowing contents of a table. please guys help! ...

Javascript function call to ASP.NET

My Javascript function calling a sever side callback function. This is working fine when I give alert(). If I comment alert() then the browser throw a warning .. My function is function callMe(){ var input = 'input parameter list'; var val= <%=gridCtrlUsers.ClientID%>.callbackControl.Callback(input); // If I comment t...

window.onload() is not firing with IE 8 in first shot

Hi all, I am trying to make my pages work correctly with IE 8, I found out from here: http://www.masykur.web.id/post/How-to-Make-Our-Website-to-be-Ready-for-IE8.aspx that, my page has to be XHTML 1.0 compliant and atleast CSS 2.1 compliant, I made my page and CSS compliant with only few warnings, but still window.onload() is not firing....

Best way to find DOM elements with css selectors

What's the easiest way to find Dom elements with a css selector, without using a library? function select( selector ) { return [ /* some magic here please :) */ ] }; select('body')[0] // body; select('.foo' ) // [div,td,div,a] select('a[rel=ajax]') // [a,a,a,a] This question is purely academical. I'm interested in learning how thi...

Do I need to do string sanitation before adding to DOM?

In our team we came up with the idea that we have to do sanitizing of strings before added to the DOM. We expected at least that double quotes would be troublesome if used in setAttribute and < and > if added to the node content. The first tests showed something different. We are using innerHTML to set a nodes content. This escapes all ...

Wanted: Resource for documented Cross-Browser differences

Where can I get a list of browser differences in the implementation of DOM? ...

How to customize this already custom jQuery sort solution?

Hi, i found the following solution to add sorting capabilities to jQuery (ref: jQuery sort()). I've altered the solution to sort strings of unknown length. It works nicely, however as you might notice from the function name: it sorts acscending :-). jQuery.fn.sort = function() { return this.pushStack( [].sort.apply( this, argumen...

JavaScript, loop all selects?

Well im new to javascript but why does this not work, all i want to do is to get a list of all selects on the page. var elements = document.getElementsByTagName("select"); alert("there are " + elements.length + " select's"); for (i = 0; i < elements.length; i++) { alert(elements[i].getAttribute('Id')); } Edit: the error is that it...

submitting multiple forms with javascript

My script: <script language="JavaScript"> function submitform() { document.playsong.submit(); } </script> Submits the below form: <form name="playsong" method="post" action="submit.php"> <input type="hidden" name="play" value="2009-05-19-3934.data"> <A href="javascript: submitform()">Play 1</A> </form> How can I change this so th...