var objs = new Array();
function Foo(a) {
this.a = a
$("#test").append($("<button></button>").html("click").click(this.bar));
}
Foo.prototype.bar = function () {
alert(this.a);
}
$(document).ready(function () {
for (var i = 0; i < 5; i++) {
objs.push(new Foo(i));
}
});
is it possible to make it so that ...
Hi,
I have a large table with with each cell being 25x25 and a div inside each one. Each div has the class of "node" and a background colour is applied to them all. I'm in the process of writing some jQuery code that will change the colour of each div when the mouse goes over it while the mouse button is down.
I currently have it so it...
I have the following code:
function CreateRoundbox(selector, scope) {
$(selector).wrap('<div class=\"' + scope + ' dialog\"><div class=\"bd\"><div class=\"c\"><div class=\"s\"></div></div></div></div>');
$('div.' + scope).prepend('<div class=\"hd\"><div class=\"c\"></div></div>').append('<div class=\"ft\"><div class=\"c\"></div>...
hi..everyone..i want after i type "0203-ED" in textfield ...two character behind that text can control the radio button.. "ED" character from that text can make one radiobutton which has value="ED" are checked...
this is my code:
<script type="text/javascript">
var model=$("#tags1").val();
var version[0,0]="JD";
var v...
Hi guys,
The scenario is this:
My html page is on http://www.mydomain.com/somepage.html
Using jQuery, I call a webservice on: http://subdomain.mydomain.com/webservice.asmx/somemethod
At the moment this is not working. I suspect that the subdomain is breaking a x-browser restriction. Any ideas?
It is working locally when the html p...
Here's my code:
HTML:
<ul id="more-items">
<li><label class="button">hi</label></li>
<li><label class="button">hi</label></li>
<li><label class="button">hi</label></li>
</ul>
Javascript:
$('ul#more-items label.button').live('click', function()
{
alert(1);
});
Clicking on the labels doesn't cause the alert() to fire. Th...
I am updating some div as follows:
for(var i = 0; i < data.length; i++) {
var query = base_url + data[i];
$.ajax({
url: query,
type: 'GET',
dataType: 'jsonp',
timeout: 2000,
error: function() { self.html("Network Error"); },
success: function(json) {
$("#li" + i).html("...
Hey,
I'm trying to add a jQuery validator rule dynamically and it's not working. It doesn't throw any errors but doesn't trigger the validation.
Here's the js:
$(document).ready(function () {
$.validator.addMethod("TIME", function (value, element) {
var re = new RegExp(regexp);
console.debug("Validating " + value)...
I have a simple form that I want to validate using blur if the text field is empty.
The below code should work, but keeps alerting me even if I pop in some text, please, what am I doing wrong?
var name = $("input#name").val();
$("input#name").blur(function()
{
if (('input#name:empty'))
{
// Testing
...
Hi guys,
How to refactor the follow to put NOT is(":checked") syntax, instead put the codes being executed in the else block?
if ($(this).is(":checked")) {
// do nothing
}
else {
// To do here
}
Thanks for all the help.
...
Hi all:
Can you explain what the following selector mean?
$("input:checkbox.compbox")
Thank you.
...
dear all..i've a textfield, it using barcode scanner for input data..after scan it shows KD-R411ED 105X0001...
I'm successful separate them into two text field use ".change(function)"
$("#tags1").change(function() {
var barcode;
barCode=$("#tags1").val();
var data=barCode.split(" ");
$("#tags1").val(data[0]);
$("#tags2").val(d...
i want to display entire row (but the search opertion could be done in a particular column(td)).
by using this /**
$(function () {
$('input#searchCode').quicksearch('table#employeeTable tbody tr',{
});
});
*/
i can search a text in entire row.but i dont know to search in a specified column and display entire row...
...
Hi All,
I'm working with a theme for wordpress and for some reason the map will not show up. I'm not sure what's happening.
I'm also getting a 602 error when i'm double clicking on it in the backend. But doesn't seem to be erros here.
Thanks so much in advance for any help
...
I'm using a context-menu jquery plugin and I need to detect what browsers support this. How can this be done?
I heard some versions of opera and safari don't support this right-click overriding business
...
Hi,
I am stuck here, i am trying to animate number of 'x' divs (the code below is just for one div) by selecting their original 'top' position & adding some 'newTop' pixel values to them.
var dur = 1500;
var origTop = $("#div_x").position().top;
var newTop = parseInt(origTop) + 30;
$("#div_x").animate(...
Hi all:
I would like to write a syntax whose effect is opposite to $(parentID).children("tr.sc:hidden").
Do jQuery get ("tr.sc:show") or similar syntax?
Thanks
...
this one a code for read two character behind text "KD-R411ED"
var code = data[0].substr(data[0].length - 2);
how to read ED character if text like KD-R411H2EDT? i want a new code can combine with code above..please help!!
look this:
<script type="text/javascript">
$("#tags1").change(function() {
...
I'm trying to implement IP address validation on my page.
I have a test box displaying my current IP address
A hidden variable having the same
I have two buttons Save & the other Revert, On Save the new IP address is written to the DB; on Revert, I need to restore the old IP address from the hidden variable to the visible box.
I'm u...
Hi All,
I am new to Ajax and have been following a tutorial from JQuery.com. I have set up a script that is very simple, when an h2 element is clicked a php script is called that returns some xml which JQuery the uses to replace the current h2 contents. Below is the javascript content:
$(document).ready(function () {
$('h2').click(fu...