jquery

How are you managing adding multiple instances of an object to a transient object in MVC?

I have an object that has a few different List properties that contain child objects. I'm trying to wrap my head around the best way for the user to select and add these child objects from a New view (where I'm creating a new instance of the parent object). As an example, suppose I have a Project class and a "New" ViewPage that present...

Ajax call to aspx page JQuery JSON

I ‘m trying to make an Ajax call to an aspx page On the server side request comes as "object object" and I cannot serialize it getting “not a JSON primitive.. ” it works however when instead of json object I pass json string .... Problem is that on a client side I’m using a json object that I have to convert to string before sending. I ...

How to dynamically add a div using JQuery?

I have the following html which displays 3 textboxes and an add button: <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div id="container"> <div id="line-item"> <asp:TextBox ID="txtLineNumber" runat="server"></asp:TextBox> <asp:TextBo...

Adjusting elements based on scrollHeight using JQuery

Here's what i have so far: function loadOff(){ $(document).ready(function(){ $("#eLoader").ajaxStop(function(){ $(this).hide(); $("#eventsContent").show(); var h = document.body.scrollHeight; $("#bodyBackground").css("height",h+100+"px"); $("#sidePanel1").css("height",h-105+100+"px"); ...

JavaScript Closures and Memory Leaks

I read in Jquery in Action that memory leaks can result from javascript closures. "Unintended closures can have unintended consequences. For example, circular references can lead to memory leaks. A classic example of this is the creation of DOM elements that refer back to closure variables, preventing those variables from being reclaime...

paging through database results using jquery

I'm looking for info on how difficult it will be to page through a number of results from a database using jquery. I have already found a plugin but I don't think it's what I need. I have a form with 8 textboxes. I want to populate these 8 textboxes with the first database result and then show paging if there are more results. If there ...

jQuery - Check Checkbox based on Select Value

Hi, I'm after a small jQuery script that will check the appropriate check box based on what value is selected in a Select element input. eg. If the value 'P.J. Gallagher's Drummoyne' is selected in select#CAT_Custom_70944 then input#drummoyne-list.checkbox is checked. The same goes for all the options in the select list: 'P.J. Galla...

Not able to bind click event to newly created span items (jQuery)

Hi guys. I'm not able to bind events to a list that is generated by jQuery. I've looked at some similar issues, but havent found any solution. This is the code that generates my list: var list = '<ul>'; for (var i = 0; i < data.length; i++) { list += '<li id="' + data[i].id + '"><span class="btnRemoveItem" title="Remove item from...

Help required on JQuery Autocomplete plugin

Hey guyz need some help with JQuery. I have a requirement in my project to provide an autocomplete feature for a textBox like the one recently applied on google. I need to fetch data on each keystroke so I am calling a JQuery fuction on keypress. The problem is the Autocomplete feature gets triggered on mouse click in the textBox and not...

Remove CSS from a Div using JQuery

Hi, I'm new to JQuery. In my App I have the following: $("#displayPanel div").live("click", function(){ $(this).css({'background-color' : 'pink', 'font-weight' : 'bolder'}); }); When I click on a Div, the color of that Div is changed. Within that Click function I have some functionalities to do. After all that I want to remov...

Trigger Mouse Dragging in jQuery UI

Using jQuery 1.2.x and jQuery UI 1.5.x, one was able to trigger dragging manually like so: jQuery("#myDiv").mousedown(function(ev) { target = jQuery(ev.target); if (target.hasClass("drag-me")) { target.draggable({ helper: "clone", start: function() { console.log("drag start"); }, stop: function() { jQuery(this).dragga...

getting check box value

hi, I want to get the value of the check box in the result variable. But I get the value as 'undefined' in the alert box. What is my mistake? var result = ""; $("#required").change(function (){ result= $(".mycheckbox:checked").val(); alert(result); }); <div class=".mycheckbox"> <input id="required" type="checkbox" title="Require...

jquery table read input field value

Hi all! I made a place management system where you can create, delete or edit placenames. I'ts a table where in every row there is a placename an edit button and an delete button. At the end of the table there is a "create new place" button. Now when I click on the "create new place" button then I get a new generated row where I can wr...

synchronous jquery json request

I need to make a synchronous request to the last.fm API, but when I use GET and json together, the request becomes asynchronous. my code: $.ajax({ async: false, dataType: "json", url: "http://ws.audioscrobbler.com/2.0/?method=artist.getimages&amp;artist="+artist+"&amp;api_key="+apiKey+"&amp;format=json&amp;callback=?", succ...

Attach a * to my DIv on click of the checkBox in JQuery

Hi, I m new to JQUery..If i checked the checkBox as Required ,i need to get a * to a div. <label class='Label3'>Options <input id='option1' class='checkbox' type='checkbox'></input><label class='choice' for='checkbox'>Required</label> <input id='option2' class='checkbox' type='checkbox'></input><label class='choice' fo...

JavaScript: “Access Denied” and “Object doesn't support this property or method” errors

I’m working on an application that uses the ajax control toolkit 1.0.20229.0, jquery 1.3.2 and thickbox 3. We are in the process of removing the ajax control toolkit, but since it’s a large app it will take several versions before we can completely remove it. When I click a link that pops up a thickbox modal containing iframe it works,...

jquery-problem using val() in IE6

Hey, I'm trying to get a textarea's value to update using jquery as outlined in the below code: <button type="button" onclick="setLine();">Set</button> <button type="button" onclick="showLine();">fire!</button><p></p> <textarea id="hello"> </textarea> <script type="text/javascript"> $('#hello').val("hi there"); ...

Welcome Loading ... Page with Jquery

How can I implement a welcome screen for 5 seconds giving information like Loading application ... + some application infos...while the main page loads in background. ...

jquery loading image while elements loads

hi im looking for any tutorials/articels about inserting a loading gif while elements load, ive seen it in a few sites. i can only seem to find articles on preloading images. ...

Applying Style to last li in a ul with CSS / Jquery

Given the following HTML: <ul> <li><div>Some content</div></li> <li><div>some more content</div></li> <li><div>final content</div></li> </ul> I would like to apply a top border around each div. On the last div I would like to put a bottom border. I am targeting IE7/8. I have the top border working fine, I need help getting th...