jquery-ajax

How do you preserve HTML in a jQuery AJAX request?

I am working on a project that I want to implement AJAX, and I have decided on jQuery as a JavaScript Library. Here is the HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head runat="server"> <title>jQu...

Using the jQuery validatation plugin to send multiple values to an ASP.NET MVC controller action?

Hi, Using the jQuery Validation plugin and AJAX, how can I validate the contents of say an input (textbox) but pass more than one parameter to a controller action? A brilliant example of passing a single value via AJAX using the plugin can be found here. ...

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? ...

AJAX Page Download progress

I want to get the progress of my AJAX request - how much has been downloaded so far out of how much the file is. For example, I am downloading a large picture with AJAX so I can put the content in a DATA url (this may not be the best way to do that, it's just a example.) So, I make the AJAX request to some host I have no control over (...

jquery ajax request failing in IE

The following ajax call is failing in IE. $.ajax({ url:"{{SITE_URL}}/content/twitter.json", dataType:"json", error:function(xhr, status, errorThrown) { alert(errorThrown+'\n'+status+'\n'+xhr.statusText); }, success:function(json) { ...Snip... } }); The error function returns Undefined parsererror OK...

Deserializing json from client in json.net 3.5b2 in vb.net

I have a test case of a problem I'm having, basically I create a json object on the server and provide it back to an AJAX called made on the client side. That works fine, however, when I try to send it back and deserialize it server side I get the following exception: No parameterless constructor defined for type of 'System.String'. ...

JQuery refresh database results on click

I have this code in JQuery: $().ready(function() { {exp:weblog:entries weblog="locations" show_expired="yes" show_future_entries="yes" orderby="date" sort="desc" limit="5" rdf="off" disable="member_data|trackbacks" status="open|featured|ongoing"} $('a.Favorites_Trigger_{entry_id}') .click (function() { $.get(this.href, function(data) { ...

JQuery Passing Variable From href to load()

I am trying to pass an href id to load() in JQuery, I can see from the alert the returned id# 960, so I know the id value is getting past I just don't know how to append the load url, well the $("#refreshme_"+add_id) is the important part, I use that to refresh the unique div id in the page assigned by the database pull, so it would be l...

Jquery Tabs- Load Contents only when clicked

Hi, I am relatively new to jquery and web development. I am using jquery tabs to create tabs. But i want the contents to be loaded only when i select a particular tab. Can someone please help me with this? ...

JQuery Effect Multiple Elements

Trying to hit two elements with one load() and not successful in what I am trying. This is what I have now to refresh a section on the page and it works fine. $('#refreshme_'+request).load("http://www.example.com/add_list/"); I tried this $('#refreshme_'+request, .xPlanner).load("http://www.example.com/add_list/"); and that did n...

Rebinding functions on dynamic content using jQuery and AJAX

I'm in the process of building a back-end admin panel for a site and I'm having an issue with the jQuery and AJAX code is use to build the page. On load, I bind actions to certain table fields allowing users to add or delete a colour or size. When they submit the form, I empty the table and use AJAX to generate a new one, then put the n...

How can I update a page content with jQuery Ajax and ASP.NET MVC??

Hi!! I have a ActionResult named "MyPeriods(string dateSelected)" and in the end of it, I have a ViewData["periods"] = listOfPeriods (and after that, I have my return View(), fininshing up my method). When no "date" is passed, "date" is today, otherwise, "date" is the date passed as argument. And this "date" is important to select all t...

How can I update a ASP.NET MVC ViewData via jQuery ajax?

Hi!! I have a page that highly depends on a IList (in ActionResult "MyEvents") that I pass in ViewData. Something like that: ViewData["events"] = listOfEvents; and in the end, I just return View(); And in my View, I take this ViewData["events"] and do a foreach in it so I can iterate through its contents. But, this ViewData must be dy...

jQuery: Using an <a> link to submit an ajax query

I am trying to send a php script some content to be stored in a database via ajax. I am using the jQuery framework. I would like to use a link on a page to send the information. I am having trouble writing the function that will send and receive the information, everything that I have tried is asymptotic. EDIT The idea is that the user ...

Ajax onSuccess callback while not having any control over ajax calls

I have a simple JS function that needs to get called when AJAX call succeeds, however i don't have any control over the AJAX calls since the framework (DNN5) handles all that. How do i call my function on AJAX success? I use DNN5 and jQuery, if you're not familiar with DNN, just assume that all the controls on the page are wrapped in t...

jQuery stop working on updated page via Ajax in ASP.NET MVC

Hi everyone!! I have a ASP.NET MVC page of Events of a specific day. I'm also using jQuery datepicker and when I select a day, I create a function that send this selected day via Ajax to a MVC ActionResult method and this method will treat this day, will do all the database stuff and will return me all the Events of this selected day. S...

Should I add AJAX logic to my PHP classes/scripts?

I just started making a PHP/AJAX site and I was wondering where I should add the functionality to "only include the content". Should I have if statements in my header and footer scripts that check for a "ContentOnly" get parameter? And then append that parameter to the query strings in my AJAX calls? Or should I use a filter on the AJ...

Is it possible to submit DIV elements (NOT Form) using jquery/ajax

Is it possible to submit FORM DIV elements (NOT Form) using jquery/ajax? I know of multiple was you can use jquery.form.js and jquery.upload.js. But they don't meet my requirements. I have the following HTML within my ASCX control (within my ASPX master page that already has a FORM tag) <div id="Div1"> File: <input type="file" id="...

Rearranging div hierarchy with jquery

I'm using jQuery's form plugin to submit a form asynchronously. The server sends back HTML which goes into a div #boardcontainer by setting the target of an ajaxForm call. This works fine. ... var options = { target: '#boardcontainer', // target element(s) to be updated with server response beforeSubmit: sho...

How to load external content to a div using jquery (think embedded lightbox)

Using Thickbox is great it allows me to load external sites into the thickbox and they retain their functionality, appearance, etc. I know how to load simple content into a div with jquery but I am stuck on how to load external content to a div in a page (preferably via onload event) and have that div act like Thickbox and retain the fu...