ajax

How to know the target element that raised the event in the ajax response callback?

I am posting to the server using jquery ajax using $.post. After server returns the response, I process the response in the callback function. In this callback function, how can I know which element was clicked on. Please check the following. In the function handleServerResponse, I would like to know the DOM element that raised this eve...

Can't load flash code into page with jquery ajax

I am trying to load some flash banner code (from database) into a webpage using jquery ajax. It is all working when adding the flash code in code-behind but when I am trying to load it with ajax some flash banners make the complete website disappear and only shows the banner. I am using jQuery Ajax and the response is in html like: <...

AJAX Calendar extender select month and year

Is it real and how can I think about it. To make so the user will select only the month and year, not date, because he need a period on full month, not some date. here is simple control ... <asp:TextBox ID="TextBox3" runat="server" /> <asp:CalendarExtender ID="TextBox3_CalendarExtender"...

Filtering out page content with AJAX in Sitecore

I have a page in Sitecore that displays the list of clients. There's a form with two select boxes that should filter out clients not matching specified criterias. Clients list should be refreshed via AJAX everytime user changes one of the values in the form or after clicking Submit button if JS is disabled. What is the suggested approac...

php javascript ajax weird string error

I am building some html in a php script in order to send it back to a page via Ajax. $other_content = Model_Db::dbSelect($query); $div_center .= "<table>"; for($i = 0;$i<sizeof($other_content);$i++) { $div_center .= "<tr>"; $div_center .= "<td><a href='#' onclick='changediv('test','0')'>".$other...

Validation/binding in Symfony Ajax form submission?

Hi, I'm using Symfony 1.4. I'm posting a form via Jquery ajax to an action which seems to work fine except that it's unable to bind the form and access the variables in the normal symfony way: if ($request->isXmlHttpRequest()) { $this->form = new MessageForm(); if($request->isMethod('post')) { $this->form->bind($r...

jquery text area problem

i have one text area <textarea name="message" id="message" class="text_field" style="height:200px; width:500px"></textarea> if i type data in the text area like this hello this is my test message bye 'abc' i use following statement to get data from text area var message = $('#message'...

ajax deleting first row from mysql list

i have a list of rows from my db with delete next to each row but ajax is always deleting the first row in the list no matter what. PHP CODE >>>>>> $allowedFunctions = array( 'add_job', 'get_log', 'delete' ); $functionName = $_GET[ 'func' ]; if( in_array( $functionName, $allowedFunctions ) && function_exists( $functionName )...

Multiple Ajax Popup Extenders

Is it possible to use two ajax popup extender controls on a page? The problem is that the div associated with the second extender is visible by default. If i set it to hidden and then later i set it visible from code, it is rendered as a normal div and not as a modal popup... Thanks! ...

Can I load data from an external page via AJAX?

I've just starting learning jQuery and AJAX. I'm able to load a local page (on my disk) into a div via jQuery.load(), but external sites don't seem to work. I've even used wireshark to check if the data is being sent from the server (it is). Sample code is below: <html> <head> <script src='jquery-1.4.2.min.js'></script> <script>...

PHP, jQuery and .post(): mysql_real_escape_string messes things up.

Hi! I have been tearing my hair with this one for a while. index.php: $(document).ready(function(){ $(".index_login_subm").click(function(){ uid = $("input:username").val(); pwd = $("input:password").val(); $.post("backend/login.php",{ uid:uid, pwd:pwd },function(data){ ...

How to return data from PHP to a jQuery ajax call

Hi, I am posting some data using ajax. I want to manipulate that data and return to to the calling jQuery script. Here is my jQuery: $.ajax({ type: "POST", url: "somescript.php", datatype: "html", data: dataString, success: function() { //do something; } }); Here is my somescript.php on the server: <?php //...

delaying actions between keypress in jQuery

How can I delay actions between keypress in jQuery. For example; I have something like this if($(this).val().length > 1){ $.post("stuff.php", {nStr: "" + $(this).val() + ""}, function(data){ if(data.length > 0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); }else{ $('#suggestions').hide(...

Confused as to which Prototype helper to use (updated)

This is a continuation of http://stackoverflow.com/questions/2397874/confused-as-to-which-prototype-helper-to-use. My code has been updated to reflect other user's suggestions: (model) message.rb: class Message < ActiveRecord::Base after_create :destroy_old_messages def old_messages messages = Message.all(:order => 'updated_at ...

Django: What's wrong with my simple ajax experiment?

I am trying to understand how Django + Jquery and Ajax calls work together. It is just a simple /test/ url that shows a single input form, once submitted retrieves the answer from the server via ajax. For that I have written a very small view: def test(request): if request.is_ajax(): from django.http import HttpResponse ...

What is a good, free, AJAX PHP solution for creating a grid with right-click functionality?

I'd like to construct a grid, preferably with pagination built in, and do GETs POSTs etc from a right click submenu and have the grid update. We were using Ext but we found it do be too bulky for our uses. Can anyone recommend another library that is easy to use? Thank you in advance. ...

Getting the Session Inside an ASP.Net ScriptMethod

I have a list of objects which I store in the session. This list then appears on a web page with little "X"s next to each item. When one of them is clicked I use Javascript to remove the item from the list on the page and then I send an AJAX call to the server to remove the item from the list in the session also. Here's where things g...

Databinding int32 to MaskedEditExtender enabled TextBox

I have a master/detail scheme for editing an asp:GridView using an asp:DetailsView. One of my fields is for a phone number of type int64 (always 10 digits). I would like this field to always be displayed as (###)###-####. My issue is the first digit in the phone number is always truncated for my edit item field which I used a MaskedEditE...

Add content asynchronously (threading + ajax).

Ok what id like to do is to load a page that displays 90% of content, and load the last 10% asynchronously. As im rendering the page i programatically create an update panel which i pass to a thread. When this thread finishes it then updates the updatepanel on the main thread. public void test(object parameter) { Thread.Sleep(2000)...

How to avoid authentication redirects in jquery .load()

Hi, I have a system that login expires after 1 hour logged in, if I use jquery ajax function .load() it replaces the content with the login page. How can I detect this redirect and reload the entire page with the login content? ...