javascript

which approach is more correct to get element in document with focus ?

I have went through couple of questions already asked related with this and i have found two common approach. 1. Have global element and update it by attaching onFocus() event to each of the element. 2. document.activeElement and have following code to update the element in case of old browser which do not support the property var foc...

How does JavaScript work internally?

I am interested in understanding the internals of JavaScript. I've tried to read the source for SpiderMonkey and Rhino but it's quite complex to wrap my head around. The reason I ask is: why does something like (![]+[])[+!![]+[]] produce "a" (Å=[],[µ=!Å+Å][µ[È=++Å+Å+Å]+({}+Å)[Ç=!!Å+µ,ª=Ç[Å]+Ç[+!Å],Å]+ª])()[µ[Å]+µ[Å+Å]+Ç[È]+ª](Å) pr...

Python List not getting in rendered in javascript

Hi, I have a javascript which takes two variables i.e two lists one is a list of numbers and the other list of strings from django/python numbersvar = [0,1,2,3] stringsvar = ['a','b','c'] The numbersvar is rendered perfectly but when I do {{stringsvar}} it does not render it. ...

problem Getting the keys alone from Associative array ? for (var key in AssociativeArray) returns all the keys and its prototype members..

Hi, I am having small problem in my JS where i need to iterate through all the keys in the associative array. var listOfKeys=new Array(); for (var key in parsedArray) { listOfKeys.push(key); } It works perfectly and returns all the properties associated to the object. Now i have a situation to add the prototype method to an arr...

Prevent access to Javascript based website or...

Hi, Some websites I develop have a great need for the use of Javascript, they will not work without it. Lots of the site functions and actions depend on some Javascript code that cannot be replaced by server-side code. Sometimes, the Javascript is so complex and needed that it's impossible to provide a fallback for browsers with Javascr...

Is it better to display latest tweets on a webpage using the PHP API or Javascript?

I want to display a user's latest Tweets on a webpage while maintaining the ability to style the Tweets with custom CSS and also maintaining good page load speed. I have managed to display the latest Tweets in 2 ways. Using the PHP Twitter library (by Aaron Brazell). By using this method, my PHP code has to wait for a response from Tw...

Checkboxes patently refuse to submit information onclick- HELP

Hi this is my second post (and second week programming, ever) so apologies in advance. I have a list of checkboxes that represent different search filters that I want passed to params. For example, if this were a restaurant search, I would want my users to be able to check off different types of cuisine that they are interested in. Ju...

asp.net date validation with three drop down list

i have three drop down list for day month and year now i want to validate this selected date in asp.net using javascript or inbuild asp.net validation control. thanks...... ...

Javascript equivalent of Python's sequence unpack: a,b=(1,2) ?

Hi, is there a javascript equivalent to unpack sequences like in python (a,b=(1,2))? Thanks in advance. ...

Copy a dir from a webserver to a mapped networkdrive

Hi All, For a PHP project I'm working on, focussing on data homogenity, a certain directory structure can be managed. After a user completes a process creating an object (I won't bother you guys with all the project details;)) this directory structure should be copied to a mapped network drive. Since the users might have the networkdriv...

JavaScript OR (||) variable assignment explanation

Hello, Given this snippet of JavaScript... var a; var b = null; var c = undefined; var d = 4; var e = 'five'; var f = a || b || c || d || e; alert(f); // 4 Can someone please explain to me what this technique is called (my best guess is in the title of this question!)? And how/why it works exactly? My understanding is that variab...

What is jQuery ?

i am new in asp.net. Can u suggest me a tutorial for jquery.I want to know more about it. any study material u have? ...

Is it possible to stop a dynamically inserted script tag?

Is it somehow possible to stop a script tag from loading after is has been added to the head of a HTML document? I would like to have something like this: var script_tag = document.createElement('script'); script_tag.setAttribute('type', 'text/javascript'); script_tag.setAttribute('src', 'http://fail.org/nonexistant.js'); document.getE...

Howto get the Value of an Selected Object in Javascript

How Can i get the value of an Selected object like select Id="foo" there are many options how can i get the value of the current selected? ...

jQuery CSS selector question

Whats wrong with this CSS selector i'm using in jQuery? Trying to select all tr's within a table of ID "itable" without a class of "mod" where its possible for multiple classes to be on each tr. if($('#itable tr:not[class~=mod]').length == 0){ //something } ...

What is the JQuery code for this snippet?

I have a parent page that contains a textarea and a link to open a child window. The child window has another textarea and a button. User enters some text in the textarea in the child window and clicks the button, a javascript gets fired that updates the content of the textarea in the parent window with that of the textarea of the child ...

Measuring Web Page Performance on Client vs. Server

I am working with a web page (ASP.net 3.5) that is very complicated and in certain circumstances has major performance issues. It uses Ajax (through the Telerik AjaxManager) for most of its functionality. I would like to be able to measure in some way the amounts of time for the following, for each request: On client submitting reques...

How to tackle with different behaviour of drop down in FF and IE?

This is in continuation of the Question: http://stackoverflow.com/questions/2099564/how-to-add-tooltip-to-a-drop-down-combobox I am using following script to show the tooltip on drop down jQuery('#myDropDownID').hover(function(e){ var tipX = e.pageX + 12; var tipY = e.pageY + 12; jQuery(...

(jquery/js) - get text from field on keyup, but with delay for further typing

Hey all. I have a form which is submitted remotely when the various elements change. On a search field in particular i'm using a keyup to detect when the text in the field changes. The problem with this is that when someone types "chicken" then the form is submitted seven times, with only the last one counting. What would be better i...

xsl:include not working from a Firefox extension

I am developing a Firefox extension that uses XSL transformations. I have been using XSLTProcessor without problems until I needed to do an xsl:include from the XSL stylesheet. When I import the XSL stylesheet that uses an xsl:include, Firefox gives an error: Error: Component returned failure code: 0x80600001 [nsIXSLTProcessor.im...