ajax

protect_from_forgery & Unobtrusive Javascript

Hi all, I have some javascript making an ajax call in my Rails site: $.ajax({type: "PUT", url: url, data: { dummy: data }, complete: function(data) {}}); When Rails gets it, it throws back an ActionController::InvalidAuthenticityToken Error. I'd like to keep the protect_from_forgery stuff in there, if possible... But I'm at a loss ...

jQuery UI Tabs and ajax form with mvc

Having problems with this setup what im trying to do is like so. Steps Fill out all elements of a Ajax.BeginForm(). Click submit The Ajax form then renders a partial view. The partial view has a list of tabs that handle different tasks. All tabs essentially have their own partial view. When each partial view is loaded they perform the...

strange javascript form behaviour.

I am generating the following html form with this php: echo "<form name=\"userForm\"> Username: <input type=\"text\" name=\"username\" /> <br /> First name: <input type=\"text\" name=\"firstname\" /> <br /> Last name: <input type=\"text\" name=\"lastname\" /> <br /> <input name=\"Submit\" type=\"submit\" value=\"Update\" onclick=\"submi...

How do I get SELECT elements to display after calling Hide() on a modal popup?

When I call Hide() on a ModalPopupExtender in ASP.NET on server side, all the SELECT elements on the page are hidden in IE6. Does controlling the AjaxControlKit.ModalPopupExtender from the server side with Hide() and Show() mess things up? ...

Request for several responses

Hi Guys, I would like to create a web application. There are cases, when a user's request would result in refreshing the content in 2-3 or sometimes even more containers. The cleanest way would be to run the requests one after the other in a sequence and handle the results one by one. I would like to have only one request if it is poss...

How is GMail Chat able to make AJAX requests without client interaction?

All HTTP responses require the client to initiate them, even those made using AJAX. But GMail's chat feature is able to receive messages from other users, even when I'm just sitting in my comfy computer chair watching but not interacting with the browser. How did they do it? ...

ASP.NET MVP and AJAX posting/webservices

When applying the MVP pattern to ASP.NET applications, where does using AJAX to post data fit? Of what I know of the MVP pattern, the UI is simply that(appearance), and all the heavy lifting is done in the presenter. I don't see how you could follow the pattern and still use AJAX interacting with web services on the client. Does anyon...

What are the technological limits to the usability of AJAX web apps?

I am trying to understand the technical limits to the usability of web-based productivity applications that use only open, cross-platform technologies such as Javascript, HTML, and CSS on the client. [1] Let's assume for a moment that in the next few years the capabilities of web browsers continue to improve (e.g. with HTML 5 and faster...

jQuery loop over JSON result from AJAX Success?

On the jQuery AJAX success callback I want to loop over the results of the object. This is an example of how the response looks in Firebug. [ {"TEST1":45,"TEST2":23,"TEST3":"DATA1"}, {"TEST1":46,"TEST2":24,"TEST3":"DATA2"}, {"TEST1":47,"TEST2":25,"TEST3":"DATA3"} ] How can I loop over the results so that I would have access to ...

Jquery - POST request turns out to be a GET request.. how come?

I never had such a problem and I'm pretty puzzled: function delete_post(id) { var answer = confirm("Are you sure you want to delete your post? (this action cannot be undone)") if (answer) { $.ajax({ method:"post", url: "ajax/delete.php", data:"id="+id, beforeSend: function(){ $('#delete_post').show('slo...

Jquery can't access original jquery objects from new div on ajx load event

I have a page that has a bunch of JQuery objects. On that same page, I have a form where you can enter search terms in a series of fields and click on a search button, which will then send an AJAX request to the server and then load the resulting HTML into a div. A very simply Jquery application... The problem is this. When you click on...

sql insert and update question

I have a form which to insert data into a database. This form takes the content of the fields, and then displays the result page showing the entered information in context. There is a link on this page to edit the user info, which go back to the previous form. Obviously, I do not want duplicate records inserted. Is there an easy way to u...

add styles to elements via jQuery on event

Hopefully this is a simple question for a jQuery newbee. Is it possible to execute jQuery methods from a javascript method? I've got some jQuery stuff adding zebra stripes to a table and some other things going on, but that table gets updated via an mvc ajax request and then none of the styles are applied to the table once the ajax call...

Ajax TreeView

I would like to see if there are any AJAX TreeView controls out there, preferably free. Any ideas/experiences? Thanks I am using ASP.net 2.0 (web forms, not MVC), c# EDITED Someone voted for this question to be closed. Just wonder why? Is it not programming related? To SO creators, if you guys allow every question to be closed, peopl...

JQuery AJAX Web Service call on SSL WebServer

Hey everyone, I am making a POST to a webservice that is local to the webserver. Everything works great until I host the site at my SSL enabled webserver. The webservice path is relative, meaning, I am making no reference to the protocol. eg. /webservices/method.asmx The POST results in a runtime error. Has anyone seen this before? $....

Read multiple variables from data object returned with ajax

I am making a jquery ajax call to an mvc controller. I want to return 2 or more variables from the controller. How do I package data in controller for this ? how do I extract with jquery? ...

Scrape HTML out of AJAX loaded pages

There's a site that uses AJAX to load in the HTML content, so when I attempt to access the URL of the page, it comes up blank. How can I scrape this site's HTML client/server side? ...

Reddit style 'join' popup

Hi, Is reddit's join popup that appears on the page hidden on the page or is it injected via ajax? How do they do it? (general terms if someone out there knows, I will dig into the source myself but need some guru pointers). ...

Pass JSON object to Web Method

I wanted to shared something I learned today with you all. My question was: Can you pass a JSON object from JavaScript code to a .NET Page Method? For example: var task = { Title: $("#titlenew input", $(newTaskRow)).val(), StartDate: $("#startnew input", $(newTaskRow)).val(), EndDate: $("#endnew input", $(newTaskRow))....

Async requests to model-bound action methods with JQuery

I have an ASP.NET MVC action method which uses model binding to accept a strongly typed model object as its input, i.e: public PartialViewResult SaveUser([Bind(Prefix = "User")]User NewUser) { } How do I specify the argument when requesting this method asynchronously with JQuery? I have previously used the load() or post() methods to ...