javascript

Copy value in textarea within two different forms (both forms in different .asp file)

Hi there, I have two different forms which is formA and formB where each form in different .asp file. In each form there is a textarea where the user need to enter their address. Beside the textarea in formB there is a checkbox where the user can click on it if the address for both textareas are the same. My question is how can I copy t...

Performance overhead of event listeners on CSS classes used in JQuery code

If my markup looks like this: <button id="button-1" class="nice"> <button id="button-2" class="nice"> <button id="button-3" class="nice"> and I define the following jQuery: $(".nice").click(function () { // something happens }); How many event listeners are established? 1 or 3? If I have 1000 buttons instead of 3, should I us...

Retrieve & display selected information in different window into a form in another window using checkbox

Hi guys, I have a form. Inside the form there are some fields for company details. User no need to fill in the field. What they are suppose to do is that they need to click on link provided and the link will pop up new window with the list of companies name in it. Beside the company name there's a checkbox. The user just need to click t...

preventing mouseout event for child node

Hi, I have list of images, on over on image i want to show some information on that image. And mouseout of the info div, same should disappear. Problem is when mouse moves on child tag of info div it fires mouseout even, which should not. And i am using normal JavaScript. <div id="pop_div" onmouseout="clearinfo()" > <img alt="" src...

How can I take common large chunks of oft-reused HTML source code?

A slew of pages I've written for one of my web projects share some 144 identical lines of code, reproduced in each file. If I update one of those lines, I have to go back through ALL of the pages that share the code and update for each page. Is there a straightforward way to include HTML from a separate file? And for bonus points, since...

JavaScript assignment

hi all, can you explain how did this assignment is work, var fe, f = document.forms[0], h; which one equal to which one. ...

Dynamic Slider

I need to integrate a dynamic slider into a webpage which sould have a dragable pointer on it.As it is dragged the value on a corresponding box should also change.There should be no upper limit to the slider.It should have numbers ranging on its body,which should change automatically when the pointer is dragged at runtime.I mean,as it is...

jQuery Plugin Options

First off, I know this is a base JS issue, not jQuery. I am at that learning point where I cannot seem to get my head completely wrapped around some scope issues. So I need some explanation. I've been reading every article/tutorial I can find, but just need some answers. I setup this base code to experiment with (as the actual code is f...

Best way to generate a random color in javascript?

Without using any framework.. I wrote 2 functions: function get_random_color() { var color = ""; for(var i = 0; i < 3; i++) { var sub = Math.floor(Math.random() * 256).toString(16); color += (sub.length == 1 ? "0" + sub : sub); } return "#" + color; } function get_rand_color() { var color = Math.floor(Ma...

Javascript Working in IE8 comp mode but not standards mode

I have a JS script that works on IE8 compatibility mode, FF, Chrome, Opera, but not IE8 standards mode. As I think standards mode is more strict than compatibility mode, maybe there's something wrong with my code. How can I debug? Is there something that shows me things that would work in compatibility mode but standard? Also, in the s...

What standalone JavaScript compressing tools are there?

Currently I am using the site at http://javascriptcompressor.com/ to compress my JavaScript. Is there any other standalone JavaScript compressing tool? ...

How to turn the V8 compiled javascript into an EXE?

I know that google's v8 compiles javascript into native machine (binary if I understand correctly) code. Is there a way to take the output and turn it into a exe? ...

Advice on JQuery UI Dialog

On my form I need to perform a task where a message appears if a users matches the criteria of being entered in to win a prize. Basically if they have a certain postcode then this message needs to appear. If they don't then the message doesn't appear. I need this to happen when they click submit. I have written a regex for the postcodes....

Problem in calling web service from javascript at FaceBook

I have an application released at facebook platform (Iframe application) at the following link FaceBookGame Application and the problem now is that i am using ajax technique in the application by calling web service from javascript and i have created the web service and allowed the web service to be called from script by preceeding the w...

javascript jquery grabbing nested attributes

This is a kind of a random thing I need. Basically my setup is something like this: <div class="classname"> <h3> <a class="anchor_classname" title="some_title">..</a> </h3> </div> The above html segment gets repeated on the page for all existing records. What I need to do is this: using Jquery, I want to grab the tooltip t...

Appending text in <a>-tags with Javascript

I now that I can insert text to <div> tag by : <script type="text/javascript"> function doSomething(){ var lbl = document.getElementById('messageLabel'); lbl.innerHTML = "I just did something."; } </script> </head> <body> <div> <div id="messageLabel"></div> <input type="button" value="Click Me!" onclick="doSomet...

Where can I find a gravatar-like script for cropping images in the client's browser?

I'm looking for a good javascript script similar to the one used by gravatar or Yahoo Profiles, I simply want the users to be able to control how their avatar will look like. Many thanks ...

active viewer component

I am using an active viewer component in my .net application to view a words document in my web application. Now I want to print out the document appearing on the viewer component with java script. I am not able to print the document in the viewer. Any ideas Many thanks in advanced ...

Wrap long-text in drop-down list ?

Hi, I have legibly long text in a drop-down list on my asp.net page. it violates the UI boundary and goes beyond the allocated region of UI. Is there anyway I can wrap [not trim] it using CSS or javascript ? I must display the entire string, no matter how long it is. ...

What is ["null"] in javascript?

I am migrating an asp code to .net. I came across the following code but not sure what is it doing. var collection = {}; if (typeof(collection["null"]) != "undefined" && typeof(collection["null"][id]) != "undefined") Can any well tell that what does collection["null"] does? If possible, how to define it in .Net Just to give an i...