jquery

jQuery in an ASP.net MVC application using Master Pages

I am trying to get simple jQuery to execute on my Content page with no luck below is what I am trying to do: <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(...

Radio buttons not checked in jQuery

I have this line of code for page load: if ($("input").is(':checked')) { and it works fine when the radio button input is checked. However, I want the opposite. Something along the lines of if ($("input").not(.is(':checked'))) { so that my if statement runs when none of the radiobuttons are selected. What is the best way to go ...

jQuery autocomplete - How to handle extra data?

I'm struggling with the following problem. I use the jQuery autocomplete plugin to get a list of suggested values from the server. The list would look like this: Username1|UserId1 Username2|UserId2 So if I start typing "U", a list of "Username1" and "Username2" pops up, as expected. I could chose the first item and the <input>'s valu...

Submit with JQuery in firefox 3 & opera in a modal dialog box from SimpleModal

I'm trying to submit a form who is rendered in a SimpleModal dialog, but my submit is never called when I'm using FF3 & Opera (Chrome, Safari and IE works). I use the following code: function ShowModal(rendercontainerid, modalcontainerid, url) { if (url == '') return; $.get(url, function(data) { $(rendercontainer...

double click function by JQuery doesn't work on radio input in FireFox

I wrote below code to remove checked item from radio group in my form by double click. $("input[type='radio']").each(function(){ $(this).dblclick(function(){ $(this).removeAttr("checked"); }); }); but this code doesn't work in FireFox but work in IE. anybody know what's the problem? tan...

Catching 302 FOUND in JavaScript

I use jQuery to make an AJAX POST request to my server, which can return HTTP response with status 302. Then JavaScript just sends GET request to this URL, while I'd like to redirect user to URL in this response. Is this possible? ...

Complete AJAX feedback

I build JQuery/JS/PHP/mySQL app with DB records management and need to provide reliable & complete feedback to the user on AJAX calls, modifying back end DB records. The problem IMHO is $.ajax success: and error: functions indicate just AJAX transport layer success and not the whole process. What if BD modification fails? How can one pro...

jQuery - looking for a better selectors syntax

I've got HTML code that roughly looks like this: <li id="someid-11"> <img src="..." alt="alt" /> <h2><a href="somelink"> sometext </a> <span><a class="editcontent" href="?action=editme">Edit</a></span> </h2> <div id="11" class="content"> <!-- // content goes here --> <div class="bottom_of_entry"> </div> </li> I'm using the a.e...

Cross Domain Javascript Bookmarklet

Hi Everyone, I've been at this for several days and searches including here haven't give me any solutions yet. I am creating a Bookmarklet which is to interact with a POST API. I've gotten most of it working except the most important part; the sending of data from the iframe (I know horrible! If anyone knows a better solution please le...

Unable to load XML data in jqGrid

I am using jqGrid of which I downloaded from here http://www.trirand.com/blog . I followed the tutorial word by word to test out the grid. Now the alterations I did is that the page from which the grid gets the data is in asp.net instead of php. The problem is that the grid loads fine and there is a response with the xml data that I ge...

jQuery not parsing JSON properly

I have a problem. I built a script to make a request to an internal link that sends back a response. This is what the script looks like: jQuery.get(callUrl, function(data){ console.log(typeof data); jQuery.each(data.items, function(i,item){ console.log(i); ...

AJAX delete - using jQuery

Hey, I have a simple cart page that displays items that are in someones cart, and having it display via an ASP while from my table. I have a column where a user can delete an entry. I have the ASP working properly, now I am trying to add some AJAX in to it. I have the following code: $("img.delete").click(function() { var id = $('#i...

Conflict between Drag and drop and sortable jquery plugins

I have a conflict when trying to mix those plugins, i have based my script in some demos. The problem is that when i drag something inside the same list it triggers the drop event and that item is added to the end of the list, wich is correct if the item is dropped in another list, but not in the same, when i drop it in the same list i w...

Overlay in IE 7 to prevent messing with controls in background

I haven't got a unique problem, but for the life of me I can't figure out what I'm doing wrong. I have a page that has a series of sections. Part of the section is a little image. When the image is clicked, I want to show a custom control. Showing the control is trivial, set the z-index a bit higher to ensure the control is on top of...

How many lines of code is in your custom jQuery script on your site? And how much is too much?

For our site, Im using a lot of jQuery - right now Im looking at 340 lines of jQuery code on top of the base library. How much is too much? I will be adding more, when do I start trying to condense the code and eventually move to OOP? ...

Can You Trap These Radio Button Events On Internet Explorer?

Consider this sample code: <div class="containter" id="ControlGroupDiv"> <input onbeforeupdate="alert('bingo 0'); return false;" onclick="alert('click 0');return false;" id="Radio1" type="radio" value="0" name="test" checked="checked" /> <input onbeforeupdate="alert('bingo 1'); return false;" onclick="alert('click 1');return false...

How to get a table cell value using jquery?

I am trying to work out how to get the value of table cell for each row using jquery. My table looks like this... <table id="mytable"> <tr><th>Customer Id</th><th>Result</th></tr> <tr><td>123</td><td></td></tr> <tr><td>456</td><td></td></tr> <tr><td>789</td><td></td></tr> </table> I basicly want to loop though the table, and get the ...

Setting ajax url for jQuery in JS file using ASP.NET MVC

When doing a Ajax call to an MVC action currently I have my javascript inside the View, not inside its own JS file. It is then very easy to do this: var xhr = $.ajax({ url: '<%= Url.Action("DisplayItem","Home") %>/' + el1.siblings("input:hidden").val(), data: { ajax: "Y" }, cache: false, success: function(response) ...

ASP.NET - Ajax requests with jQuery

Hi, I've got this textBox which triggers off an ajax request using jQuery: <asp:TextBox ID="postcodeTextBox" runat="server" Text='<%# Bind("POSTAL_ZIP_CODE") %>'> $(document).ready(PageLoad); function PageLoad() { $(container + 'parentProjectTextBox').change(GetProjectName); } function GetProjectName() { var projectNumber = ...

Trouble with jQuery selector using ASP.NET MVC

Howdy. I'm new to both ASP.Net MVC and jQuery and what I'm trying to do is make a form that either adds a new RockBand or updates an existing RockBand based on if the rockbandid is an empty guid or not. I figured now is a good time to get rolling with jQuery. So the first step is to make a list of bands and put an edit link next to it...