ajax

Best way to transfer an array between PHP and Javascript

So I have an array of records retreived from a database. The array is in the format; $rows[0]['id']=1; $rows[0]['title']='Abc'; $rows[0]['time_left']=200; $rows[1]['id']=2; $rows[1]['title']='XYZ'; $rows[1]['time_left']=300; //And so on upto 10-20 rows What's the best/most elegant way of transferring this array over to my javascript...

jQuery .load seems to be running at an unexpected point

So I'm trying to load some returned html from an .aspx page but a click event needs to fire before it doing some stuff that the AJAX request depends upon. More specifically, I'm doing this. When a user types in a text field this function is run... function KeyPress() { $("#" + HiddenButtonId).click(); $("#test").load("TempJumpToAJ...

Which JavaScript framework (jQuery vs Dojo vs ... )?

There are a few JavaScript frameworks/toolsets out there, such as: jQuery; Dojo; Prototype; YUI; MooTools; ExtJS; SmartClient; and others I'm sure. It certainly seems that jQuery is ascendant in terms of mindshare at the moment. For example, Microsoft (ASP.NET MVC) and Nokia will use it. I also found this performance comparison of ...

Simple Modal in JQuery

Dear all, I am using SimpleModal in JQuery, and I have One Confirm Dialog ,If it is Yes , I have To Call my.php into This Dialog,However I done the code ,I still Searching Ideas, any help? $(document).ready(function () { $('#confirmDialog input.confirm, #confirmDialog a.confirm').click(function (e) { e.preventDefault(); ...

Ajax - Library or Plain Javascript

I've been doing a lot of reading about AJAX, and wanted to know which is the better way to approach things: by using a library such as jQuery using their built-in methods or creating JavaScript without a library for AJAX? ...

Cross-site XMLHttpRequest

I want to provide a piece of Javascript code that will work on any website where it is included, but it always needs to get more data (or even modify data) on the server where the Javascript is hosted. I know that there are security restrictions in place for obvious reasons. Consider index.html hosted on xyz.com containing the following...

Implementing a self resetting XMLHttpRequest object

I'm trying to implement a comet style, long polling connection using an XMLHttpResponse object. The idea is to maintain an open connection to a server which sends data when it is available (faking push). As soon as the XHR object completes, I need to spawn a new one to wait for any fresh data. Below is a snippet of code which outlines a...

JSON security best practices?

While researching the issue of JSON vs XML, I came across this question. Now one of the reasons to prefer JSON was listed as the ease of conversion in Javascript, namely with the eval(). Now this immediately struck me as potentially problematic from a security perspective. So I started doing some research into the security aspects of ...

Ajax jQuery , beginner question

I'm trying to make an ajax call to grab session data to insert into my page after it's loaded like this jQuery(function(){ // Add Answer jQuery(".add_answer").livequery('click',function(){ var count = $(this).attr("alt"); count++; var count1 = count-1; $.get('quiz/select', function(p_type){ // Ajax Call for Select D...

Ajax Toolkit ReorderList Two components with the same id 'componentid' can't be added to the applicaiton

Line 3655 Char 59 Ajax Toolkit ReorderList Two components with the same id 'componentid' can't be added to the applicaiton. When using with a database to update a simple list it works fine until it is being used very fast dragging multiple things reasonably fast. This occurs in IE, Firefox and Chrome. It appears to be something that all...

Drag and drop, editors

How can I make a drag and drop editor like the one in wufoo.com form editor ...

SimpleModel Resizing the Container

Dear All, I have Used SImple Model, Now Problem Is The Resizing of Modal, I have Confirm Dialog One is Basically Small size after pressing Yes , The Second One is my.php contains large Data,I am Using the concept of Appending Already existing model ,Will any body tell how to Resize the Content and My JS Snippet Has ...

Live Search using ASP.NET MVC and AJAX

I am looking to implement a live search in my MVC app similar to this site when you type in a question and results come up that are similar or like the search on http://www.krop.com/ I have the search code all working and results updated. I just need to know how to add the AJAX to the MVC framework (I know this site was built using it) ...

How do I Invoke Ajax OnClick from Provider Web Part to Consumer Web Part

I am attempting to manage an ajax connection by calling a button onclick method on a separate web part in order to force the partial postback on the consumer. Web part A (Provider) invokes the method on Web Part B (Consumer) Web Part A Type t = myButton.GetType(); object[] p = new object[1]; p[0] = EventArgs....

Loading HTML controls from JSON in JQuery (i.e., reverse of ajax serialiseArray)

I would like to take a set of controls (INPUT, SELECT, TEXTAREA) which are contained within a DIV and send their values as JSON via AJAX to a server. This is easy enough with JQuery's serializeArray. However I then want the server to respond with the same structure of JSON that was sent and re-load the control values using the provided...

Are Web Operating Systems practical yet?

I'm a full time web developer but I have my roots as a desktop programmer and there seams to be a lot of talk about Web Operating System these days. Is it practical yet to incorporate your web applications into a Web OS to make it more user friendly or just do a traditional HTML layout? I found one that looks very interesting which is ...

Long-lived connections (asynchronous server push) with Apache/PHP/Javascript?

I come from more of a Java background. In the last year or two, it's become somewhat popular to do server push over HTTP using long-lived HTTP connections in Comet. It's an extremely useful technique. So I'm curious what the equivalent is with Apache + PHP + Javascript? One option I see is just using straight AJAX calls (eg with jQue...

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

Web page -user custom style

How can I give the user the ability to change the style of a webpage, of course I have to make several CSS files , but how can I make the code that permits the change upon the user's choice ...

Simple Modal Not Working In Firefox 3 & IE 7

I am using the simple modal and AJAX, when I try to read the content from AJAX it works fine in Chrome. There is problem in IE7 and Firefox 3. What am I doing wrong? My code: print("code sample"); $(document).ready(function () { $('#confirma, #confirmDialog a.confirm').click(function (e) { e.preventDefault(); // exam...