In the following example, how do I modify the variable "sizeMod", which is a property of each object?
// Will be created by ids
var objs = {};
// Set up objects
$.each(ids, function(index, value){
objs[value] = {
sizeMod: 0
};
objs[value] = {
change: function(){
sizeMod += 1; // How do I write th...
I am creating a dynamic table of three columns and multiple rows. I want to be able to click the last cells in each row and have the row be selected showing a certain color. I am trying to do this as well as make sure that if another cell is selected already it will deselect. I am having a few issues not sure exactly what to do. I can c...
When building a jQuery plugin, do you think it's bad practice to embed the source of another plugin or library that it depends on?
It seems to me that it's a better way to go than requiring users to do multiple <script src="..."> calls or compressing the multiple source files themselves.
...
What are the specific disadvantages (if any) of dynamically including the CSS and JS files for a website?
By dynamically, I mean, using the document.write() method generate and tags.
I'd like to use this technique on a very large, high-traffic website, since it allows me to easily manage which files are downloaded for which site sect...
$(document).ready(function(){
/* fetch elements and stop form event */
var submitData = $("form.follow-form").submit(function (e) {
/* stop event */
e.preventDefault();
/* "on request" */
$(this).find('i').addClass('active');
/* send ajax request */
$.ajax({
type: "...
Hi,
I want to call a function onclick and pass the event object to the function:
progressBarOuter.onclick = function(e) {
var x; if (!e) {
x=window.event.clientX;
}
else {
x = e.clientX
}
yt.clickedOffset = x; yt.progressBarClicked
}
So i'm assigning clickedOffset to by enclosing ob...
I can't figure out why this isn't working. I draw an image onto a canvas, use getImageData, manipulate the pixels and then store that array of pixels for later. When I'm ready to draw those pixels later, I use createImageData on another, identically sized canvas, set the resulting ImageData object's data property to the array of pixels...
I need to encode and decode IEEE 754 floats and doubles from binary in node.js to parse a network protocol.
Are there any existing libraries that do this, or do I have to read the spec and implement it myself? Or should I write a C module to do it?
...
Possible Duplicate:
Alternatives to JavaScript
Hi there,
As there are many programming languages, and you have options, that which ever language you want to work on, like you if you use C# then you have option that you can use VB.NET or C++ etc further you we have Java which can replace C# or C# that can replace Java. So we h...
Hi,
I am using PHPUnit to test my PHP source code, but I need a way to test client-side code, too. I use ExtJS to build rather complex interfaces that call the server for data. I am wondering here is how does one test the UI?
...
I have a problem with jQuery Quicksand and jQuery Lavalamp plugins.
It seems they conflict and don't work together. I wonder why and how can I solve this?
I'm using jQuery 1.4.2
...
I've just inherited a projected with a lot of client side validation.
In this I have found a regex checker, as expected without a comment in sight. I'll admit regex is definitely one of my failing points. (In Javascript!)
var myRegxp = /(([0]*[1-9]{1})|([1]{1}[0-2]{1}))(\/{1})((19[0-9]{2})|([2-9]{1}[0-9]{3}))$/;
if (!myRegxp.test(args....
Hi all,
I've been coding a bit of Javascript to place a ducky randomly on this page.
I wanted to make it hide on the side of objects (like the posts), but I ended up having to hardcode quite a bit of it, since I couldn't get a way to properly retrieve the real position of relative objects with Chrome. I read quite a few things about it...
I have just taken over maintenance of a large web application which is over 10,000 lines of Javascript.
At the moment it runs on Firefox 3.5+, Safari 4+ and Chrome and I have to make it work with IE8.
I am a very experienced programmer but I only have a little Javascript experience - although I have been introduced to the dubious pleas...
I can't get my map to appear when I'm using the Google Maps API. I am trying to build an application, and it won't work there, but it is also broken in this testing page I've made. Does anyone know what it is that I'm doing wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tran...
Hello everybody, I'm trying to disable/enable multiple form elements of an HTML page using javascript. I have a form with many fields, each row of the form has a checkbox to enable/disable the elements on the row.
The problem is, only the first two form elements get disabled (no matter the order). After that, the remaining javascript co...
Dear All,
I am new to stackoverflow i have doubt regarding calling jsp from javascript file.
my file contain one html file with javascript(home.html) and one jsp file(login.jsp)
In html(home.html) file i have 2 textbox and 2 buttons one for login and another for reset.when i click the login button i should call a js for textbox field v...
Hi I am still learning Jquery and have a problem accessing form elements. My script opens up a div and then fills it with a pre written html form. I am using ajax to get the form and jquery. This all works fine and I can see the div box with my form in it. The problem is I want to populate the innerhtml form and I have tried javascript a...
Hey,
I have a Date() object that contains a UTC date, which I need converted to the users local timezone. Does anybody know how I could do this? :-)
Thanks in advanced!
...
I have a print button with id="print_req". I wrote some Javascript code for printing a page, which is triggered by clicking on this button, and I also want to hide this button before printing, and show it after whole printing process.i mean not to print button in my printed document. Here is my code:
$(document).ready(function(){
$(...