javascript

control names in a custom validator .NET Client Side Validation

Hi I have a gridview with three columns of textboxes. It can have as many rows as necessary but its usually only about 5 rows. Each row needs to be validated. I want to create a client side validator that sums 2 of the columns together and compares it with the third column to check that the user has entered the data correctly. Just in...

Date validation

Has someone validated date of this format Feb 9, 2010 12:07 PM in javascript previously.There is a problem with javascript Date object its accepting Feb 9,2010 00:07 PM as a valid date. ...

How can I print a certain block/part of a web page?

How can I print a certain block/part of a web page? Print option to look like Print Screen functionality. ...

Clearing the field of File Upload Control

Can any one pf you please tell me how to clear the File upload control value using javascript. ...

Why can't I set value to display in a div?

So I'm new to JavaScript and I'm trying to figure out why doesn't this work: My function has this line: document.getElementById("displayResult").value = ("test"); and this is my div: <div id="displayResult"></div> ...

Strange behavior on function calling.

When calling a Javascript function, it seems like JS gives priority to functions without parameters first, even if I have the same function name with parameters. The strange behavior only happens in the following scenario: I have a an HTML page with embedded Javascript, like this: //Javascript in the page function testAbc(){ ...

Implementing Communication Between JavaScript Code and Console Application C#

Now I'm solving web server performance testing task and a have a little problem. There is a way to communication between DHTML and C# code. It works perfectly in Win Application but I need Console Application. So I create simple test Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; nam...

how do i avoid including jquery twice?

i have a service i'm building, which will be included as JS on client web pages. optimally, i want to build the service using jquery. the case may arise, where the page already has JQ included. how do i avoid including JQ twice in the page? how do i make sure i still have the desired JQ functionality, even if the page has already inclu...

Detect anchor is leading to an active window.location

Having such an html: <a class="someclass" href="some/url/absolute/or/relative">Blah</a> ... along with such javascript: $("a.someclass").onclick(function() { var link = $(this).attr("href"); if (link == window.location) // <<<<<<<<<<<< doSomethingSpecial(); else doOtherThing(); return false; }); this...

How to open new incognito window with Javascript? (Google Chrome)

Hi, I want to help my friend (and not myself ;)) open a porn website in a new incognito window when he performs some mouse gestures (custom stroke in Mouse Stroke - Chrome Extension). ...

JavaScript syntax

In another question answered here I found the following JavaScript code: function _dom_trackActiveElement(evt) { if (evt && evt.target) { document.activeElement = evt.target == document ? null : evt.target; } } But this syntax is unknown to me, could someone explain exactly what document.activeElement = evt.target =...

disabling property of a textbox

hi friends, when i click on a text box or start typing in a text box, its showing the previously entered string below it, i want to disable this property of a text box, how can i do this? please help me Thanks ...

Javascript Regex - capture everything except C-style comments

The problem: I'm trying to style certain keywords (e.g. "function") within the content of a code-tag, excluding those keywords from the C-style comments that appear in that content. Solution: I believe that a match of the innerHTML-string of the code-tag against a Regex-pattern, that would exclude the C-style comments could do the job.....

How to count Matching values in Array of Javascript

please tell me any good algorithm/code to get list of unique values from array and count of its occurrence in array. (i am using javascript). ...

Trigger onmouseover event programatically in JavaScript

Is there a way to programmatically trigger the onmouseover event in plain JavaScript? or "extract" the method from the onmouseover event to call it directly? eg <div id="bottom-div" onmouseover="myFunction('some param specific to bottom-div');"> <div id="top-div" onmouseover="????????"></div> </div> top-div is above bottom-div, s...

Access top window from Iframe in Adobe Air

Hello, everyone! I have some problems with Adobe Air. My application has rather complicated architecture: the main html window loads iframe with references to javascripts (e.g. DWRengine.js, jquery.js, main.js and so on). It's done to avoid Air's javascript restrictions on 'eval' function, which is widely used in my scripts and in DWR t...

JQuery - Fetching a URL that returns 404 on first few fetches, then returns 200

Fetch a URL - mywebiste.com/blah.php --> returns 404 Fetch a URL - mywebsite.com/blah.php --> returns 404 Fetch a URL - mywebsite.com/blah.php --> returns 404 Fetch a URL - mywebsite.com/blah.php --> returns 200 // how do I loop until this the URL returns 200? Previously phrased: So I have a URL (foo) that I need to download after m...

image thumb list with opacity changes and add class/remove class on click

I got the script from another post on here, but for some reason it isn't working quite correctly on my implementation of it. Everything works fine except for stripping of the "selected" class, therefore the thumbnails all stay highlighted after being clicked. Easiest way is to show in context: http://www.studioimbrue.com/beta I changed...

targeting frame one frame from another.

i have main html page which have two frames frame1 and frame2. frame1 is showing tree.php page and i want that when i click on node of tree displayed in tree.php some html or php page should be displayed in frame2. how i can achieve this??? ...

Whar are equivalent cross-browser solutions for window.showModalDialog?

Whar are equivalent cross-browser solutions for window.showModalDialog? showModalDialog introduced in IE and FF 3. ...