ajax

how to return an error in an Ajax scenario from ASP.NET MVC action

I am using ASP.NET MVC with jquery. I have the following MVC Action that returns a partial page on Success. On Application Error, I am not sure what to send it for correctly handling it at the client side. public ActionResult LoadFilterSet(int filterSetId) { try { BreadCrumbManager bcManag...

jQuery.load and form elements

Is jQuery's .load() supposed to be able to load <form> elements? Because it seems to be stripping them out. So I have some code like: $('<div></div>').load($link.attr('href') + ' #divDlgContent', function(){ ... }); and when the $dialogcontents loads, I return some content with a <form> inside the DIV with the id 'divDlgContent'. A...

Using jQuery to listen for an AJAX load that is not loaded using jQuery.AJAX

Okay, have a bit of a tricky one (for me anyway, i'm pretty rubbish at jQuery/JavaScript). I'm pulling in data using standard AJAX (ie, NOT using a framework like jQuery or whatnot... there is a reason for it) However, I then need to load up a jQuery script as soon as the page has been loaded in. So, here is the question, how do I bind...

How to exclude params from XML rendered in Grails ?

Hi, I have a class : class Category { String name SortedSet items static hasMany = [items:Item] } Inside the controller, I render category as XML (converters) : def getCategory = { render Category.read(1) as XML } But I want exclude items from the rendering. How can I do ? Thanks ...

ToolkitScriptManager throws NullReferenceException during concurrent access to a page for the first time

Hi everybody, i'm developing a ASP.NET web application which uses the AjaxControlkit 3.0.30512.20315. I have a ToolkitScriptManager instance on my master page which has some ScriptReferences in the CombineScripts collection. If i access my default page from 2 differenct clients after an iisreset, i get the following exception [NullRefe...

how to catch ajax query post error?

I would like to catch the error and show the appropriate message if the ajax request fails. My code is like the following, but I could not manage to catch the failure ajax request. function getAjaxData(id) { $.post("status.ajax.php", {deviceId : id}, function(data){ var tab1; if (data.length>0) { ...

Is there a recommended approach to handle saving data in response to within-site navigation without onunload event?

Hello all, Preamble to scope my question: I have a web app (or site, this is an internal LAN site) that uses jQuery and AJAX extensively to dynamically load the content section of the UI in the browser. A user navigates the app using a navigation menu. Clicking an item in the navigation menu makes an AJAX call to php, and php then retu...

Convert PHP site to Ajax-driven site

After weeks of failure, I am completely lost as to how I can covert my site to be ajax based. The main purpose is that I have a bar at the bottom that plays music and I would like it to play as the pages change. Please help me figure this out! The Ajax area includes: Google AdSense and Adbrite ads (although I can go without these in A...

Countdown timer?

How do you make a Countdown timer? When the user loads the page, clock starts counting down, it reaches time, it redirects browser to a new page. Found this, it was not too useful. http://encosia.com/2007/07/25/display-data-updates-in-real-time-with-ajax/ ...

ASP.NET MVC + Forms Authentication + AJAX: Polling action without resetting auth ticket expiration

Is there a way to mark a Controller Action to not reset the Forms Authentication ticket sliding expiration? I want to poll the server every x seconds for new info using ajax but that will effectively prevent the user session from ever expiring. ...

How to get selenium to wait for ajax response?

How can I get selenium to wait for something like a calendar widget to load? Right now I am just doing a Thread.sleep(2500) after exporting the testcase to a junit program. ...

What's the name of the technique where the images on a web page fade in as they scroll into view?

Here's a webpage that does what I'm describing: http://mashable.com/2010/05/13/mobile-tech-journalists/ What's going on with the images? It seems that they get loaded and fade in as you scroll them into view. Is there a name for this technique? Is it a new optimization technique? Where can I read more about it? ...

How can I ensure that JavaScript inserted via AJAX will be executed after the accompanying HTML (also received via AJAX) is ready in the DOM?

I've got portions of pages being replaced with HTML retrieved via AJAX calls. Some of the HTML coming back has JavaScript that needs to be run once in order to initialize the accompanying HTML (setting up event handlers). Since the document has already been loaded, when I replace chunks of HTML using jQuery's .html function, having jQu...

jQuery AJAX PHP JSON problem

Hi Gurus I'm facing the problem of receiving an empty array when I do an AJAX request in the following way: This is the code I'm executing in JavaScript: <script type="text/javascript" src="lib/jquery.js"></script> <script type="text/javascript" src="lib/jquery.json.js"></script> <script type="text/javascript"> $(document)...

jquery with ASP.NET MVC - calling ajax enabled web service

This is a bit of a continuation of a previous question. Now I'm trying to make a call to an AJAX enabled web service which I have defined within the ASP.NET MVC application (i.e. the MovieService.svc). But the service is never being called in my getMovies javascript function. This same technique of calling the AJAX web service works o...

$.(ajax) wrapper for Jquery - passing parameters to delegates

I use $.(ajax) function extensively in my app to call ASP.net web services. I would like to write a wrapper in order to centralize all the ajax calls. I found few simple solutions, but none address an issue of passing parameters to delegates, for example, if i have: $.ajax({ type: "POST", url: "http://localhost/Templat...

Google Maps within a dynamically loaded jquery Accordion

I'm trying to load a google map within a jquery ui accordion with contents loaded by ajax. $("h2", "#accordion").click(function(e) { var contentDiv = $(this).next("div"); if (contentDiv.children().length == 1) { contentDiv.load($(this).find("a").attr("href")); contentDiv.ready(function(){ var latlng = new google.maps.La...

Invalid length for a Base-64 char array.

I'm getting the following error in my ASP.net web page: Invalid length for a Base-64 char array. This happens when a user activates an ajax request before the previous request completes. How can I prevent this error from occurring? edit: here's the stack trace. Because the error doesn't appear to be happening in my own code, I'm not...

ASP.NET (AJAX) UI Design Tools for Artistically Challenged?

I'm building an application but I'm artistically challenged and I'd rather not spend my time writing widgets (e.g. ability to collapse/expand/close/drag-drop) if there is already controls available. I've worked with the Microsoft AJAX Control Toolkit - but these tools still require a lot of work to get a working widget (which in my case,...

Get data from aspx.cs page to aspx page.

So I am using a jquery plug in that allows me to change the order of things in a list by dragging and dropping them. So my goal is to be able to grab a list of my objects (AlertInfo) and using it in a javascript function. I was able to use a json webservice call in a test project to pass the data to the page. But we don't have a webser...