ajax

Best Practice for when to implement Ajax?

In this Microsoft tutorial they implement Ajax in the final step: "Step 7. Implement Ajax" I know it's only a tutorial so it's kept simple but I have seen this idea elsewhere too, build the app and then sprinkle ajax where appropriate. I implement ajax as I go but I am wondering what people feel is a best practice concerning this. Is ...

Why are my text fields getting wiped out?

I've got a partial that is called by Ajax to add new line items. If I type in some data in the part ID field then click the link to Add another item, it wipes out what I just typed. View: <label>Parts Used <%= Ajax.ActionLink("Add another item", "BlankEditor", new AjaxOptions { UpdateTargetId = "partusageitems", InsertionMode = In...

AJAX + dynamically adding java script function to the page

I am loading a portion of page using AJAX calls, which may contain script functions defined in them . Which are attached with the controls being loaded with different events. Now the problem is that when those events triggered i got the error "object not found" which indicate the function is not found/defined. While using Firebug i can s...

extra mystery space in php code

I am trying to pass a variable frm php to a javascript function, however a space keeps getting appeneded, and I can not see how. The relevant php code snippet: <p><a href='#' onclick=\"makewindows(" . $html . "); return false;\">Click for full description </a></p>".$brand." <p><a href=\"#\" onclick=\"deleteRec('".$ARTICLE_NO."', '...

jQuery callback not being called

I'm using the .post AJAX method of jQuery: // completion toggling $('.item input').click(function() { $.post('complete.php', {item: this.id}, function() { $(this).parent().fadeOut('slow'); }); }); What am I doing wrong here? The AJAX works as the record is updated but the callback event never happens. No errors in Fire...

Problem with link_to_remote in rails

I'm having a consistency problem using link_to_remote in rails. I have 2 use cases of link_to_remote, and they generate different ajax. I can't figure out why, and it is driving me crazy. Here is use case one... <%= link_to_remote "section-", :update => "sections", :url => {:action => :destroy, :controller => "sections", :id => @sect...

Is there a way to use jQuery.getScript inside the AIR application sandbox?

I 'm trying to build an AIR application using the HTML/JS engine (not flex nor flash), but I'm facing an issue while trying to load dynamically a JS file form the application directory. Once the application has launched, if I try to load a script using jQuery.getScript method, the script is never interpreted and no error is thrown. I've...

which ajax script library do you recommend?

There are a lot of JavaScript libraries out there these days (extJs, Scriptaculous, Dojo, prototype, Solvent and many more). Couldn't find any site comparing cons and pros. Could anyone give recommendations? Things to consider: - size - performance - Cross-Platform - ease of use and documentation - (special reason to use a specific one ...

Refresh Using Ajax/PHP

Further to my question yesterday (here), I am working on a webpage that has a section that shows 'live' order details. The top half of my webpage has Spry Tabbed Panels. One of the panels contains an include call to a separate php page that I have created (getOpenOrders.php). This contains an SQL query to obtain all open orders and then...

onblur ajax not calling the callback function

I Have the following code which is called inline as below also. The problem is the alert never fires. In firebug i can see that data is filled with my object, but still the alert doesn't fire. Any ideas? function update(s_arrive) { $.post("../base/getDestInfo.asp", { "dest": s_arrive }, function(data) { alert('aa'); }, "json"); } <...

YUI: customizing message browser shows when cancelling window close event

I have a YUI application. Under certain circumstances I want to alert the user before he closes the window. Therefore I capture the window close event and do onWindowClose: function(e) { if (...) { YAHOO.util.Event.preventDefault(e); } } The browser shows a standrd message: "Are you sure you want to navigate ...

Speed up loading of 30-40 dynamically loaded images on each pageview.

I've got a social community with a lot of traffic. In the right column of the site's layout, we got a "online list" that prints out a 40x40px thumbnail pic of friends, people in your area etc. 30-40 images in total. Just before the right column loads, it hangs as all these images are loaded. I need a faster solution compatible down to ...

AJAX+ASP.NET

As far i learned ....AJAX is used for partial page refresh (overcoming the flickering effect in the web page) ....Is there any other features in AJAX.... ...

Use of ajax to call JMS

Hi I have the followig code: page1.jsp The ajax function called on click of button function ajaxFunction() { var xmlHttp; xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { alert("Data loaded"); } } xmlHttp.open("GET","page2.jsp",true); xmlHttp....

Faster way to populate <select> with Javascript

I have two <select> boxes on a form. Selecting an item in the first <select> box will determine what should appear in the second <select> (Using Ajax http_request). In some cases there can be a large 500 (guess) items in the second select and it takes time 5-10 seconds to update in IE. Firefox seems to work perfectly. I wonder if th...

What is this kind of javascript? And Help with AJAX request.

I recently asked this question: http://stackoverflow.com/questions/694849/dynamically-query-a-database-to-check-for-value/694860#694860 And I got an awesome and informative answer. But whenever I search on Google to find out more about "Ajax Requests" the codes never look similar to the one provided. Also I have used another tutorial t...

Javascript/css/php/mysql to collect user email addresses in a div on a website.

Suppose you want a box on your website that says "Give us your email address and we'll send you news" or somesuch. What's a simple/elegant way to collect those email addresses (assuming a standard LAMP stack)? In particular, I'd like recommendations on Javascript to handle the UI (complain if invalid email address, say thanks when t...

Can't post twice from the same AJAX TinyMCE textarea

I've a list of elements editable via a simple AJAX/jQuery edit button, which works great. But when I try editing the same field a second time it doesn't want to play ball. EDIT - AJAX returns a tinyMCE textarea containing content from MySQL SAVE - AJAX posts tinyMCE contents to MySQL and displays posted content EDIT (again) - Returns t...

Bind GridView via jQuery ajax

I am new to jQuery, trying to populate a GridView or Telerik RadGrid using jQuery. Not sure how to go about it and unable to find any examples. Any help is appreciated. Thanks. Essentially I am trying to display a modal window with a textbox and button. The user enters a search criteria presses the button and a gridview in the same moda...

Company doesn't want to use ASP.NET ajax...what can I do?

Developers and management tell me that they want to move away from using asp.net ajax because it is big and cumbersome. I kind of agree, but I don't want to do all the javascript heavy lifting myself. Eventually I also want to introduce jQuery. I'm guessing right now it will also be a problem. Is there a good post somewhere outlining...