javascript

Javascript lights out (css manipulation), like in YouTube

How do I use javascript to black out all content except a single html element? This is Chrome-specific app so CSS3 can be used. ...

Getting value of an element inside facebox div using jquery

Hello, I have two div tags as shown below on my page. When i reference the value of itemName element,using $('#itemName').val(); which i have in both the divs, i always get the value of the element in the first div which is ""(blank). Is there a way to get the value of the itemName element in the 2nd div i.e. facebox using jquery ? inf...

Find whether Save or cancel button is clicked on print dialog box

Hai Guys, How to find which button was clicked by the user on a print dialog box..... ...

how to clear an label value in javascript

hi, I have an label "test" comimg from .cs [c# code] text="data saved successfully" . but once I click the save button i need to clear its text right now I have 3 required field validators. with message [cannot be blank, cannot be blank,cannot be blank,] as user as clicked the save button I need to...

Javascript Unit Testing Frameworks?

Can anybody recommend a Javascript unit testing framework. I've found JsUnit (http://www.jsunit.net/) and will start evaluating it. I just thought it would be good to get some input from the community. ...

Javascript eval multiple variables does not work

Hello, I got an array which I iterate over and try to create a variable. The name of the variable is variable and comes from the array. So I am using eval (this code will only be used on my local computer) to create the variables. Weird enough I can create a variable and add plain text to the contents of it. But whenever I try to set a...

jQuery .submit problem

I'm having a little problem with jQuery: I'm having .submit() defined on a form, when I submit the form by clicking the submit button, the even triggers and things works smoothly, however, when I use document.forms[0].submit(), the event doesn't get triggered, but the form submits!! Is there any reason why? How can I overcome that? ...

why isnt this php working, i get undefined index...?

Hi. I am trying to upload an image to the server. I hava a form with a couple of inputs... INSIDE this form, I have an Iframe which contains another form for the upload, this because I dont want the original form to submit(). The original form basically: <form> ...... bla bla bla alot of inputs....<iframe src="pic_upload.html">...

focus a cursor to submit button?

I have a form for login.when i put the username and password then press enter it gives the search result.The search text box is in the same page.I want to make the focus to submit button.The enter key issue only appear in IE?what can I do to solve the problem...Thanks in advance... ...

Append value to multidimensional array

function append (array, value, dimension) { switch (dimension) { case 0: array.push( value ); break; case 1: array[array.length-1].push( value ); break; case 2: array[array.length-1][array[array.length-1].length-1].push( value ); break; case 3: array[array.length-1][array[array....

How to send js array via ajax?

I can only send string or numeric values,how to send an array? ...

How to create a xmlhttp request?

var url="display.php?vote="+grade; xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("txtHint").innerHTML=xmlHttp.responseText } } This piece of code fails to send out the...

Counting div elements based on id

I have a page similar to: <div id="content"> <div id="boxes"> <div id="box:content:1:text" /> <div id="box:content:2:text" /> <div id="another_id" /> <div id="box:content:5:text" /> </div> </div> I want to know the number of div with id that matches the expression box:content:X:text (where X is a number). I can use pure javasc...

How to raise mouse and keyboards events in JS

Is there a way to send mouse events and keyboard events in JavaScript? Does all browsers support this need? -Datte ...

Javascript stop event flow

Hello, first of all sorry for the strange title but I wasn't sure how to call this. I am trying to create a slideshow for images. Actually it's more like a fade in and out show. I could explain the whole thing but I think it's a lot clearer if I just posted my code. var Images = ["images/1.jpg", "images/2.jpg", "images/3.jpg", "images...

Create reflected image with HTML Canvas?

I have the following code which tries to combine a vertical mirrored image with a transparent to background color gradient. When combining these two effects it fails, do I need to overlay a PNG gradient over the canvas instead of trying to get the canvas to perform both operations? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transition...

Why does hitting enter key in the textbox in firefox browser set Page.IsPostback value as true?

Hi, I've an aspx page which has got a textbox and a submit button.Entering data in the textbox and hitting the button shows a listview control which displays data retrived from the database.Listvew has sorting,pagination,edit functionalities. For each of these,the corresponding method is triggered on the server side...for example: lv_so...

JavaScript doesn't work in IE: Sudoku Puzzle

http://home.earthlink.net/~benfranq/Sudoku.html Perhaps somebody can tell me why it doesn't work in Internet Explorer In other browsers, it seems to work fine. I've tried adding semicolons to every line, but it still doesn't work. This isn't my page, a friend asked me to figure out why it isn't working in IE but ok in other browsers....

Google closure compiler error "Variable COMPILED first declared in {SyntheticVarsDeclar}"

When using the Google closure compiler to try and compile a load of closure dependencies taken from their editor demo (no external code) using calcdeps.py I get the following error when then running the compiler on the produced code (which runs fine): {SyntheticVarsDeclar}: ERROR - Variable COMPILED first declared in {SyntheticVarsDecl...

jquery javascript: take action when radio button is selected

I have the following radio buttons, none of which is checked by default. <input type="radio" name="location" value="0" /> home <input type="radio" name="location" value="1" /> work <input type="radio" name="location" value="2" /> school How do I detect when either of them is checked. I'm looking for something like click, but it's not...