ajax

How to send large text in AJAX Request using prototype?

Hi All, I have a situation where I have to send a large text in ajax request using method :POST. I have tried to do like this. new Ajax.Request(url + "?" + params, { method: 'post',postBody: {'Test':'Test'}, onSuccess: function (transport) { switch (transport.responseJSON.Status) { ...

jQuery - form loaded via ajax.load not responding to click on submit

I'm seeing a strange problem in my jQuery in a Ruby on Rails application: I'm loading content using ajax.load() into an absolute positioned div (modal). The loaded HTML contains a <form>-element with both action and methodparameters as well as a submit-button (input type=submit). I have another form present in the 'main' document (with ...

How does web server detect Content-Type for a response document?

I have 2 identical xhtml-documents which are in html (1st) and xhtml (2nd) extensions. The difference is in extension only. Using ajax (jQuery 1.4.1) I try to get 1st, but web server (IIS 5.1) sends response with Content-Type: text/html instead of application/xhtml+xml. If I try to get 2nd, there are no problems. For both documents I ...

What is the recommended method to read JSON data posted with JQuery AJAX in ASP.NET?

I currently have a JQuery Ajax method as below; $.ajax({ type:"POST", url: "default.aspx/UpdateData", data: jsonString, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg){ alert('saved'); } }); In the ASP.NET UpdateData method I'm using; System.IO.StreamReader sr = new System.IO.StreamR...

How to know that a callback function has fired?

How can I know that a callback event has fired? I have to perform an activity after the callback event has fired, should I put the code inside the callback function or is there some other way to know when the callback has fired? Even if I put the code of the activity after the statement making the javascript request I cant be sure that t...

Track Ajax requests on a page

I have a web page and I am associating a note with the page storing it in my database, so that the whenever the next time the page is loaded that notice can been seen till it is deleted by some other user authorized to do the same. However, say I associate a note with the page after some content is loaded through AJAX. I want the note to...

jQuery AJAX - Make content appear by default

I'm using jQuery AJAX to retrieve a page with different user selected options. I'd like the page to appear by default with default options so in $(document).ready I call the function which contains the AJAX. This creates a delay in loading as the browser first loads the actual page, then the jQuery javascript file and then finally it re...

IE issue dealing with "unsecure content" - Javascript BUG

Hi there everyone, I've got a problem with a web application, a rich internet application in fact, in which every component resides on a secure https connection. Common content are: html files, images, js files and the like, all are on and retrieved from https connections. A single part of the application (when a tab action gets execu...

Scripts inside partial view not working when displayed using Ajax Actionlink

Partial View <script type="text/javascript"> $(function() { alert("Message"); }); </script> User Control Text View <%= Ajax.ActionLink("Show Control", "ShowControl", "Home", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "controlPanel" })%> <div id="controlPanell"></div> Controller public ActionResult ShowControl(...

jQuery: How to deal with response data in ajaxComplete event

Say I have this code: function onComplete(event, request, settings) { // How do I get the data? In the correct format? } $('body').ajaxComplete(onComplete); In regular ajax success handlers, I can just access the data directly since it will be the first parameter to the handler. It will also be in the correct format (as long as t...

Object serializable for AJAX, WCF and ViewState

Hi, consider the following class and struct public class Entity { public IdType Id {get;set;} public string Data {get;set;} } [TypeConverter(IdTypeConverter))] public struct IdType { ... any data ... } The IdTypeConverter can convert the IdType struct from and to string. Now, what I want is this class to be serializable...

Drupal Views Ajax refresh rows

Hi! I have some view (Views 2 - list of invitations, table style) which uses embedded forms to edit records directly in view rows. I am using ahah to change values in records. What I need is to refresh all records dynamically (some calculations) after I change some checkboxes. Is there any way to refresh view using Ajax? To trigger reloa...

Javascript does not recognise dynamic div content

I have a script i have been battling with now for like a week. I have a page which has a div with id ("content"). Now I loaded some content, a form contained in a div tag to be specific, into this div VIA Ajax, and it is displaying fine Now, the challenge is - When the form is submitted, Im am calling a function that will disable all t...

Asp.Net single control render for AJAX calls

I'm trying to implement something similar to this or this. I've created a user control, a web service and a web method to return the rendered html of the control, executing the ajax calls via jQuery. All works fine, but if I put something in the user control that uses a relative path (in my case an HyperLink with NavigateUrl="~/mypage....

Ajax: Json vs XML

With the exception of needing an XML file, is there a benefit to using XML over JSON? JSON seems like an easier way to handle a return but I have very little experience using one or the other ...

PreLoad and cache image in jQuery for "loading" icon (or any better solution)

I am working with dynamic tabs in jQuery. When the user opens a new tab, the content is loaded via ajax: function addTab(tabId) { $("#tabs").tabs('add', tabId, tabId); $(tabId).load("..."); } I want to display a loading icon while the content is being loaded. So I am setting the tab panel content in the add property of the tab...

Rails, AJAX, and jQuery..just add water?

Excuse my daftness, but I can not understand how ruby vars can be attained with jQuery. I made a button that by json POSTS to the server to make a credit_status = 0. But I would like that 0 to also auto-update on the page as well. My View: HQ $ = organization.total_credit = link_to 'redeem', redeem_admin_organization_path(organization)...

jquery json problem

look at this function please $(".menu_tree img.edit").click(function() { id = this.id; lang = '<?=$lang_id?>'; var body_width = $("body").width(); var body_height = $("body").height(); $("#shadow").width(body_width); $("#shadow").height(body_height); $("#shadow").show(); ...

Anyone know about a good multiple file upload script using php/mysql and ajax/javascript?

Hi, as the title says: Anyone know about any good/simple multiple file upload script that uses php/mysql and ajax/javascript? I want it to show a progress-bar, and easy customization. I've tried uploadify and fancyupload, but I would want the option of adding a description and title. (and I've got some bad experience with uploaders usi...

Is there any way to have a [System.Web.Services.WebMethod] method in a standard page in c#?

Is there any way to have a [System.Web.Services.WebMethod] method in a standard page in c#? I have a c# ASPX page that I would like to have a a method for my ajax to call. I want everything to be self contained in a single file for organization and deployment purposes. When I add that directive to a System.Web.UI.Page for example: [Sy...