jQuery dynamic selector
I have some code which uses a selector in a loop. This works: document.getElementById("new_grouping_"+i).value This does not: $("#new_grouping_"+i).value Is there a way to do this using jQuery? ...
I have some code which uses a selector in a loop. This works: document.getElementById("new_grouping_"+i).value This does not: $("#new_grouping_"+i).value Is there a way to do this using jQuery? ...
I have this code, and have also tried something similar using the $.getJson function: jQuery(document).ready(function(){ var kiva_url = "http://api.kivaws.org/v1/loans/newest.json"; jQuery.ajax({ type: "GET", url: kiva_url, data:"format=json", success: function(data){ alert("here"); jQuer...
I need a regular expression that will properly work, the current one I have is breaking. The goal is Normal src for an image is: Image.png Using jQuery on hover I dynamically find the src of an image and replace it with ImageName-Dn.png On hover off it sets it back to ImageName.png My current solution: $(document).ready(function()...
I am trying to rely upon the browser cache to hold JSON data returned from AJAX calls in jQuery. Normal browser activity relies upon the browser cache all the time. Example: jpg and gif images are not refetched on a page reload. But when I try using jQuery getJSON ajax calls, I cannot seem to avoid fetching the data from the server. M...
I have this code: var myWidget = $('#myWidget'); and calls like this elsewhere: myWidget.hide(); myWidget.slideToggle(); These work of course because jQuery adds these methods. Now, let's say I'm doing some refactoring to make myWidget a proper object with its own custom methods and state: var myWidget = (function() { // priv...
I am working inside of a jQuery each iterator: $('p').each(function(){ ... }); I'd like to create an expression that evaluates to true when: $(this) is the last p element scope is $(this).parent() $(this) must be a direct child of $(this).parent() $(this) is not necessarily the last direct child of $(this).parent() Here are a few s...
I need to provide the P.O Box validation for the address Fields Now we have a regex validation in jquery which has some limitations as follows: If an address polo Rd is given, it identifies "po" in polo and alerts error message. So, we should frame a new validation which should not accept address lines with the values: "PO BOX", "PO ...
I have a table 10x10 in html if I add a function for each td hover, how can I get the cell column and row index? Thanks. ...
My first delve into working with JSON data. I have a bit of experience using jQuery though. I'm posting to this URL (tumblr api): jyoseph.com/api/read/json What I'm trying to do is output the json that gets returned. What I have so far: $(document).ready(function(){ $.getJSON("http://jyoseph.com/api/read/json?callback=?", functio...
Hi, i am doing an application which make use of JQuery and Cakephp . In this i am using like the following to retrieve the values from my controller side var getformid; $.getJSON("http://localhost/FormBuilder/index.php/forms/getFormEntry", function(json) { getformid=json.forms[0]["id"]; alert("Form id inside "+getformid); });//jso...
I'm having troubles with the order of my code in my program. right now I have some things with in document.ready(function() { } ); and some things out side of it. Whenever I move anything (to organize or improve my code) I end up breaking something, I'm guessing because of either order of declarations or access levels (ie. something outs...
I have an hidden input field with a value, <form> <input type="hidden" value="product"/> <select class="select" name="select3" id="select3"> <option>0</option> <option>1</option> <option>2</option> </select> </form> I need to get the value of input field once a button is click...
In jQuery: I'd like to create an link to on click shows a hidden div (got that working by now) but also slides to it with a smooth-scroll effect. How do I combine the two? Thanks so much. ...
I'm making a call to a page method via AJAX in my ASP.NET application via JQUERY's AJAX method e.g. $.ajax({ type: "POST", url: "page.aspx/GetDropDowns", data: "{'aId':'1'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { alert(msg.d); ...
I am making an AJAX call in my ASP.NET application via Jquery to a page method. $.ajax({ type: "POST", url: "APage.aspx/GetDropDowns", data: "{'AId':'1'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { alert(msg.d); }, error:...
I am using ASP.NET MVC and jQuery. I have this code in my js file. It should hide and show certain divs when a user clicks on a radio button. I would also like to fire this on the page load using the trigger method. My problem seems to be that when the event is trigger my default values from the model haven't been loaded into the cont...
Hi, just wondering how it's possible to un-select the select option box, i used .remove() but this actually removes the text from the select box, is there any other way. thanks ...
Hi guys, I've currently got a script that'll check for the value of a select box, and then enable a text field right next to it, and then hopefully set focus. I have this at the moment which works fine at enabling the input field... $("#assessed select").change(function () { if($(this).val() == 'null') { $(this).next('input').attr("...
I have about 600+ references of code similar to the following... $("#ctl00_ContentMainPane_eliteUser").html And changed the master template, only to find all the code had broken, due to the control hierarchy changing. All javascript is included in separate files, so I cannot use code such as this... $("#<%= eliteUser.clientID%>").ht...
Labels have a 'for' attribute which makes them point to a certain input field. I need to change the value of this attribute with JQuery so I could use: $("label").attr("for", "targetName"); But I also need to set the className, so i'd prefer to use: $("label").attr({ for: "targetName", className: "something" }); You might ...