ajax

jQuery User Control Mess - HELP!

I have a user control that creates a jQuery DatePicker (standard one in the UI). This user control is called twice by my page (date from/to) so I have dynamic ID's for my inputs/controls/buttons/what-not. I need to somehow set either a hidden input or use a webmethod somehow to set a variable on the user control so the search function ...

Lightbox not working in Ajax.Updater div (prototype)

I am using an Ajax.Updater call to produce a single rental listing's information in a div. A dropdown menu of all the rental listings starts things off, and the div is hidden until the user selects a listing, in which case a javascript effect makes it appear and the updater is executed. A php file is called from the updater which quer...

javascript loop only applying to every other element

i have the following javascript below after i finish an ajax query all of my images have name="pic" <script type="text/javascript"> function done() { var e = document.getElementsByName("pic"); alert(e.length); for (var i = 0; i < e.length; i++) { cvi_instant.add(e[i], { shadow: 75, shade: 10 }); } } m...

jQuery ajax success anonymous function scope

How do I update the returnHtml variable from within the anonymous success function? function getPrice(productId, storeId) { var returnHtml = ''; jQuery.ajax({ url: "/includes/unit.jsp?" + params, cache: false, dataType: "html", success: function(html){ returnHtml = html; } }); return returnHtml; } ...

Django models are not ajax serializable

I have a simple view that I'm using to experiment with AJAX. def get_shifts_for_day(request,year,month,day): data= dict() data['d'] =year data['e'] = month data['x'] = User.objects.all()[2] return HttpResponse(simplejson.dumps(data), mimetype='application/javascript') This returns the following: TypeError at /sc...

what is the slickest way you have seen with respect to tag editing.

i have a list of tags on a website next to each link and i want to allow users to edit this list (add, remove, modify) i want to come up with a slick way so they can do this without it feeling klunky so things like autocomplete, ajax without going to the server, etc have you seen any examples of really sleek ways of supporting this. m...

Ajaxtool kit popup in usercontrol

hi i have page in which i used the usercontrol in user control i use a ajaxtoll kit popup window to load a div in the user control it is working as expected when the pase ispostback is false that is for the first time when the page loads. but after the post back when i invoked the popup it is giving me some unspecified javascript error....

$.ajax and webmethod/pagemethods.

Hi I'm trying to call a pagemethod that doesn't have any parameters, and I can't seem to get it working. If I have a single parameter in the pagemethod it works fine. $.ajax({ type: "POST", url: "Default.aspx/getLastCallData", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { aler...

jquery ajax get example

At the moment I'm using the post method like this $.ajax({ type: "POST", url: "Servicename.asmx/DoSomeCalculation", data: "{param1ID:"+ param1Val+"}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { UseReturnedData(msg.d); }, error: function(err) { al...

How do I work out which trigger triggered my update panel?

I have an update panel and a list of buttons that trigger it. I need some way to find out which button was pressed when the load method (which is caused by the triggers) goes off, but I can't figure it out. Sender doesn't cast into the trigger, but the update panel itself. I need to perform some action based on which button was pressed....

UpdateTargetId ASP.NET Ajax...Where is it?

Hello SO: This is probably a silly question, but why am I unable to utilize Ajax in my project? I should have all the necessary references: System System.Configuration System.Core System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Linq System.Drawing System.EnterpriseServices System.Runtime...

Unobtrusive JavaScript with server side values, best practice?

I'm used to do doing things like this: <a href="Javascript:void(0);" onclick="GetCommentForGeneralObservation(<%# Eval("ID") %>)"> That would be in a repeater or such like btw. However I an now trying to use unobtrusive JavaScript and hence get rid of any JS in the markup. I was trying to figure out what the best practice is in case...

JQuery Ajax issue

I have this problem, I load a page using JQuery ajax, now within that page I also have a ajax submit form, somehow my ajax does not want to work on the second page, if I call that page directly the ajax works. Is it possible to include ajax within ajax as description above? ...

ASP.NET – Making Asynchronous calls to the Server

Hi, Good morning. We are building an ASP.NET website and in that we have one big page having 4 GridViews. Each grids have sorting feature enabled. We need to make an asynchronous call to the server for each grid (whenever a user clicks on a column of a grid view to sort) so that it renders fast (instead of full page getting refreshed...

How can I return an AJAX-retrieved value to the parent function of the current function in JavaScript?

I have the following JavaScript (and jQuery) code: function checkEmail(email) { if (email.length) { $.getJSON('ajax/validate', {email: email}, function(data){ if (data == false) { // stuff } return data; }) } } I want the anonymous function to return data to t...

HTTP POST from a ASP.NET MVC Ajax form does not include submit buttons.

I am unable to determine which form submit button is clicked during an Ajax Form POST in ASP.NET MVC. I have a form that basically looks like: <% using (Ajax.BeginForm("Edit", new { code = Model.Code }, new AjaxOptions() { UpdateTargetId = "re...

How do you use Javascript to duplicate form fields?

For instance, I want to have a html form that looks like this: <table> <tr> <td>Field A:</td> <td><input type='text' name='fielda[1]'></td> <td>Field B:</td> <td><textarea name='fieldb[1]'></textarea></td> </tr> </table> What I want is to add a button that duplicates my entire above form, but changes the 1 to a...

jQuery XML Ajax Call failing in... FIREFOX!

This is strange. I am used to IE crapping out on problems with XML format, but this is the first time I have had a problem in Firefox. The XML is created at this page: http://www.harrahs.com/content/events/EventCalendarFeedXml.jsp?propCode=UHA&amp;uniqueEvents=y&amp;showTimes=y The code I am using to pull in the XML is //Read X...

Is my form not submitting by design or is there something else going on here?

Hello SO: I am working in ASP.NET MVC and made a simple form that is AJAX enabled (using MicrosoftAjax and MicrosoftMvcAjax). All it does is pass the form value to a partial view, then updates the target element with the new value. Here is the view with the form: <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat=...

What are the "best practices" for AJAX with Django (or any web framework)

I am developing an issue tracking application in Django, mostly for a learning exercise but also for my own projects - and I am looking into using some AJAX for "enhanced" usability. For example, allowing users to "star" particular issues, which would add them to their watch list. This is implemented in a lot of sites, and is often AJAX ...