ajax

Links to AJAX calls do not work

Hi all i am writing a Rails application and i include some link_to_remote links The generated code is <a href="#" onclick="new Ajax.Request('/b10/categories/games?category=Action', {asynchronous:true, evalScripts:true}); return false;">Test</a> That works perfectly fine on Safari and Firefox but when i try to click the link on IE7 and...

How do I add a Microsoft AJAX auto complete textbox to an existing ASP.NET 3.5 SP1 web application project?

I played with this years ago when it was "atlas". Now I want to use it I assumed it would be a in the VS toolbox. Now all I can find on the web is total confusion! Thanks. ...

Returned AJAX html breaks IE click events

I have a table of paged data, along with a dynamically created pager (server-side AJAX call, apply returned HTML to the innerHTML of a div). When I click next page on my pager, an AJAX call is sent to the server to retrieve the next set of data, which is returned as a string of HTML. I parse the HTML and render the new table rows. I als...

GWT vs Flex vs ?

My company is trying to migrate away from a .NET application to something that is purely web-based, and very "ajaxy". The original .NET app is fairly interactive, roughly equivalent to Google Maps as far as user interaction is concerned (zoom, pan, annotate features on a vector map). Our .NET developer is really taken with Flex2. I'll...

which is better to pass a PHP var in AJAX call to another page: POST or through the session?

Hi, in a PHP site I am building, I use a Prototype AJAX call to address some other php page. This called php page needs a variable that lives as a SESSION var on the first page (in the sense that it's used multiple times throughout that page anyway). It's more curiosity than anything else but: which of both ways to pass our variable i...

Submit form using AJAX and jQuery

It seems like this should be something built into jQuery without the need for more than a few lines of code, but I can't find the "simple" solution. Say, I have an HTML form: <form method="get" action="page.html"> <input type="hidden" name="field1" value="value1" /> <input type="hidden" name="field2" value="value2" /> <sele...

How much content being replaced with an AJAX call is too much?

I run into a common problem when trying to do AJAX development. Where possible, I like to try and just update data in an existing layout, and not the layout itself. For example, take the div below: <div id="content-5">Here is some content</div> I would get the updated value for content-5 from the server and just replace the contents o...

Pushing Headers and AJAX

Hello all, I have a script that forces a download and I make a call to this via Javascript. However, the dialog box doesn't pop up, here is the download.php script: header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // ...

Can I suppress the browser’s login prompt on 401 response when using XmlHttpRequest with Twitter

I'm using jQuery's ajax methods to interact with the Twitter REST API. Their API is a bit annoying, in that some actions will return a 401 HTTP status code. In that case, I just want it to fail, instead of displaying a login box. I've tried just providing an incorrect user:pass pair in the URL, in case that might suppress the dialog a...

How to get jQuery to pass custom arguments to asynchronous AJAX callback functions?

My page deals with many "Store" objects, each of them has a field called 'data'. However, this data is fetched via AJAX requests which may be parallely going on. function Store(id){ this.id = id; this.queryparam = 'blah'; this.items = null; } Store.prototype.fetch = function(){ $.get("/get_items",{q:this.quaryparam},fun...

Is there an alternative of ajax that does not require polling without sever side modifications?

I'm trying to create a small and basic "ajax" based multiplayer game. Coordinates of objects are being given by a PHP "handler". This handler.php file is being polled every 200MS, by using ajax. Since there is no need to poll when nothing happens, I wonder, is there something that could do the same thing without frequent polling? Eg. Co...

How would I determine on the server side if a given HttpRequest was sent via ajax?

I was wondering what is the best way (if at all possible) to determine on the server side if a given HttpRequest was sent via ajax? ...

How dangerous is it send HTML in AJAX as opposed to sending JSON and building the HTML?

It seems to me that any interception of this could provide instant trouble because anyone could just send any HTML/script back to the client. The only reason I'm interested in doing this is because of the huge pain it is for front-end developers every time there's a DOM structure/CSS change so you now have to go figure out where in the ...

Global "Loading" notification with ASP.NET MVC Ajax calls

I'm interested in providing a general "I'm making an ajax call" notification ... similar to how most of google's services have a little red loading notification when it's busy making a call. Is there a way of globally tapping into some event that I can use to show/hide that notification if there is an active call? We're not using the j...

Possible to add large amount of DOM nodes without browser choking?

I have a webpage on my site that displays a table, reloads the XML source data every 10 seconds (with an XmlHttpRequest), and then updates the table to show the user any additions or removals of the data. To do this, the JavaScript function first clears out all elements from the table and then adds a new row for each unit of data. Recen...

web service being called twice with jquery ajax function

I am using the $.ajax function in jquery to make a call to an asmx service. When I look at the requests from fiddler, I see two requests for each call I make. One has a content type of text/html which of course returns a 401 not authorized status, and the other one has the correct content type and returns the correct data. Can anyone t...

Performance benchmark: PHP Generated content VS. javascrpt and DOM over AJAX

Hi, For the following pretty straightforward task: query a list of products from a DB and present it on a webpage, consider 2 setups: Setup1: PHP script queries. All content is built on the server and the entire page is served back to the client. Setup2: Static HTML "page skeleton" requesting content using AJAX. Received content is pa...

Cross browser AJAX function to dynamically load HTML

I'm looking for an AJAX function to dynamically request an HTML page. I already found the following: function ajaxinclude(url) { var page_request = false if (window.XMLHttpRequest) // if Mozilla, Safari etc page_request = new XMLHttpRequest() else if (window.ActiveXObject) // if IE { try { page_request...

Preventing to execute a javascript function more than once

Dear All I am using Javascript JQuery and PHP. My doubt isHow to limit the javascript function to execute once? My MainJQuery file has ajax, display.php ,it execute for a while .... $.ajax({ type:'POST', url: 'display.php', data:'id='+id , success: function(data){ ...

CSS stripped from content embeded via Javascript into Div

I have the following file file: <html> <head> <title></title> <script type="text/javascript" src="/Prototype.js"></script> <script type="text/javascript"> function load_content() { new Ajax.PeriodicalUpdater('content', '/UpdatedContent/, { method: 'post', frequency: 5 }); //var fileref = document.createElement("link");...