So I've got this table being generated and each cell is given a unique id which is r#c# where the # is the row/column. I've got the code below that extracts the row number and column number from the ID of the cell on mouseover, and it works just fine in firefox and chrome, but does not work in internet explorer.
var cell_id = $(this).a...
How can I make jQuery fire an event when a user checks a checkbox?
<input type="checkbox" id="test" name="test" /><label for="test">Check me</label>
I could do it with .click though that doesn't work when the user tabs to the checkbox. I wasn't able to find info on this in the api docs or while googling.
Cheers.
...
Hi,
Is it a bad idea to prototype additional features in JavaScript's native types like Array, String, Number, etc?
I think it would be great to have functionality like myArr.pop(), etc., but what if someday that becomes part of the ECMAScript x -- and differs from my implementation, so, it potentially breaks the entire software?
...
I'm wondering if this is possible: user uploads a picture which is then presented to him in the browser. The image is placed inside a div that has predefined image as background. User can drag and drop his uploaded image inside the boundaries of this div.
It would be something along the lines of uploading a pic of yourself and then pos...
Hi all,
I prefer to declare one Javascript file for my all website. I am trying to decrease the usage of global variables. My examples at the below, in both case each object has a myName field.
I would like to know when they are initialized?
And In terms of memory and efficiency which one is more effective?
For variable a, is declari...
I am trying to figure out how to highlight just some part of text inside an input box using jQuery. It's quite simple to highlight the entire contents of the input box but how do you highlight just one word or couple of letters?
Thanks!
...
I am trying to get some values from my form into a lightbox that I am calling. Everything works great if I hard code the form values into the jQuery ajax post but I can't get the form values to properly pass into ajax function unless the values have been selected and the page has been reloaded.
So somehow I need to get the values of the ...
Hi. I'm using the html5media library, which automatically replaces the HTML5 video tag on the page with the Flowplayer Flash player for browsers that don't support the video tag. This happens on IE and some older browsers.
I need to detect if the Flowplayer exists on the page and add an event listener to each instance that fires off a J...
Hi there,
I have some javascript that is built on top of mootools that is basically giving a div some show/hide functionality.
window.addEvent('domready', function(){
/*var mySlide = new Fx.Slide('customise_text').hide()
var mySlide2 = new Fx.Slide('customise_link').hide()
$('customise').addEvent('click', function(e){
$('customise...
Ok, I'm rephrasing this because it got buried.
IMPORTANT
I want to remove this Google Analytics block, using jQuery.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type...
hi,
Have you used VeguiSK, does any one out there knows how to validate input types like select-options, radio, checkbox or textarea inputs. What are the steps for the same using VegUI site kit used for client side validation
Pls suggest some answers if you have the know how?
The steps required are to be simple and using VegUI sitekit ...
I am writing the regex for validating password in Javascript. The constraints are:
Password must contain at least one uppercase character
Password must contain at least a special character
With trial and error and some searching on the net, I found that this works:
/(?=.*[A-Z]+)(?=.*[!@#\$%]+)/
Can someone please explain the part ...
In a project I am working on, I need to validate a date entered into an <input type="date">
With Safari 4/5 (on Mac OSX) the Javascript fails to parse dates of the format YYYY-MM-DD, returning NaN instead of the expected epoch timestamp.
I am using the following technique to validate the field just before the form is submitted:
//valu...
I've got a web page where I need a user to click the save button to save the content of the form back to the web server.
Part of the save is a check of items which may require a prompt to the user that allows them to confirm, edit and reorder items in a javascript popup.
If the prompt is required, I need to be able to access the respon...
var clicked = $(event.currentTarget || target);
var clickedIsActive = clicked[0] == this.active[0];
I'm fairly new to js, and while attempting to read through some jQuery code, I came across the above section.
What is the precedence for the second line?
Is it:
var clickedIsActive = (clicked[0] == this.active[0]);
Or is it someth...
Hey all. Basically, I need "(this)" in my function to correspond to this selection:
$(".widget .portfolio img")
But I want alternative ways of running this function, one when it is cilcked, and one in intervals, like this:
function cycle()
{
var poo = $(this).attr("id");
$(".poo").html(poo);
}
$(".widget .portfolio img").cli...
I have a <button> with a nested image and I'm using jQuery to toggle the image src attribute on mousedown and mouseup. When the button is clicked in IE8 the image moves down and right 1 pixel, as buttons do in IE, but then it sticks there and won't return to its original position. If I remove the mouseup event the button functions normal...
If I insert an image inside an <a> tag, how could I avoid, using js if it was necessary, that when someone clicks on that image it doesn't follow the link.
...
hi
how can i check that the value of my checked radiobutton / checkbox (between two or more) is exactly the one i want? at the moment if i check a radiogroup the validation returns always the value of the first radiobutton / checkbox.
If it's not clear i'll put up an example page.
Thanx
Vitto
...
I am trying to populate a dynamic 3 dimensional array so I don't have to type it all out
var o = {
matrix: (function(n) {
for (var x = 0; x < n; x ++) {
for (var y = 0; y < n; y++) {
for (var z = 0; z < n; z++) {
this[x][y][z] = -1;
}
}
}
}).call(Array, 5),
...
}
The message I get is...