ajax

jquery.ajax set with async=true to send data back to server not working if page redirects/reloads.

I'm trying to save some content whenever a button/hyperlink is clicked using jquery.ajax (Using Asp.net 3.5). The logic is as follows: Through .bind in jquery I bind my own method(MakeLog) to a button click or hyperlink click. The click events of button/hyperlink contain nothing, I need to use .bind for selective controls. Now we h...

Returning a variable within an ajax call

Hi all, If I have the following ajax call (inside a function) how do I go about returning the 'test' variable, in this case a string for testing purposes? Currently i'm getting test is not defined. function getMaps(){ mapID = "us"; $.ajax({ type: "GET", url: "getMap.asp", data: "mapID=" + mapID, ...

Reset one function after ajax is completed

hey guys, Im having a small problem, I'm trying to create an inline editing system with jquery. So when an user clicks on a table field the innerhtml will change into an input field with ofcourse the content of the table field. Onblur this input field is saved in a mysql db and the innerhtml change back to the new content. I want an use...

Add a row to h:dataTable via AJAX with request-scoped bean without losing the row data

I think the title tells it all: I want to add a row to dataTable over AJAX. The datatable has input fields where user can put text. As simple as that, a pretty common case. With session-scoped bean this no issue, as the same bean is updated over and over again. However, I want to do this in request scope. For each request, I guess I wan...

AutoCompleteExtender not working for WebService hosted on IIS 7

I have a web service project with a Class having web method which works fine when browsed. I have hosted this web service on IIS 7. The problem I'm facing is that when I use this URL as the value of ServiceMethod property of AutoCompleteExtender it doesn't work but when I add this Class file in my UI project and just give the Class name...

JSF2: Submit AJAX form

I have a page that has a table list through AJAX pagination, all custom. Pagination is working properly, but the Enter key clears the form input's values instead of submitting. My submit button makes an AJAX post that causes the table to reexecute and rerender. How can I make sure that all form inputs handle the Enter button and submit ...

Best practice for rails-javascript interaction?

hi, I have a page which shows a Google map. I'd like to use Javascript to fetch several points from my database and place them as markers on the map. So the flow is: Javascript calls a Rails action with parameters. Rails queries the database. Rails returns the response. Javascript updates the page (Rails can't do this since it must be...

Checking inside of the div tag with innerhtml in javascript?

hi fellows im trying to make a registration form with ajax validation check. validation check is OK. i make it show a cross.png image when there is a problem about a field on the form. but what i wanna do next is to not let visitors apply the registration form when there is problem. i tried to check for errors by if(document.getElemen...

How to submit form using AJAX?

I have an event listener: $('button.publish').live('click', function() { //enter code here }); This button element is inside a form. I know that I can't use $(this).submit(); 'cause it will cause refresh. I also can't target the form by its ID because I'm trying to make it for general use (add news, add contact, add ...). Knowin...

jquery click event

I have some jquery that looks like this, $('.career_select .selectitems').click(function(){ var selectedCareer = $(this).attr('title'); $.ajax({ type: 'POST', url: '/roadmap/step_two', data: 'career_choice='+selectedCareer+"&ajax=true&submit_career=Next", success: function(html){ ...

How to display loading page before page with search results displays?

Usually when using any web page that is used to search for huge amount of data, like searching for cheap flights, user is first redirected to a page that shows progress bar e.g. 'Now Searching Multiple Travel Sites..', and when search on the server is done, then is redirected to actual search results. How that is done? Is it some javasc...

JQuery method to get one node - rather than find();

I've been googling this for an hour and can't seem to find the answer. I'm using $(xml).find('title') -- but it seems to be returning all the "titles" in all nodes. How do I just grab the title within the root node? <response stat="OK"> <title>Some Document</title> <menu> <item> <title>Some Title</title> ...

Is there a way for php or ajax to get image size in bytes or kb or mb right away?

I have a nice php and ajax script that uploads a photo and displays the image after uploading. I also have rules that it must follow too. But my problem is the maxSize is 2mb, and right now when you choose an image and you start to upload it -- it basically looks at the whole upload (which can take a while) and then it tells you if the...

jQuery will not return data after upgrading to new jQuery version

I upgraded my jQuery version to 1.4 from 1.3. My code worked fine in 1.3, but it doesn't in 1.4. What can I have done wrong? function add_product_to_shopping_cart( product_id ) { $.post("/actions/etrade/add_product_to_cart", { 'product_id': product_id, 'variant_first': $('#main_variant-'+ product_id ).val(), ...

jQTouch Dynamic Web app???

I'm working on a dynamically changing web app. I'm using javascript and jQuery to populate DIV's with <li>'s and <a>'s. For example, I start with one menu dynamically built with javascript. From that menu, depending on item selected, another javascript function gets called to dynamically populate the corresponding DIV. The problem comi...

jQuery: Whats up with the success:

<script type="text/javascript"> var fixed = 1; var sizew = 122; var sizeh = 160; /* * function crop() * ajax function which returns the cropped image */ function crop() { $.ajax({ type: "POST", dataType: 'json', url:"functions.php?action=crop", data: {x:...

Sys.Application.add_init Not Invoked on UpdatePanel Update

I have a custom UI control which has a JavaScript class written around the AJAX.NET framework. It inherits from the Sys.UI.Control. The control itself is a UserControl. In the render method I wrap the control in a span and give the span's id the ClientID of the user control. This way I can do this later on: var control = $find('<%= ...

jquery.form update target some of the time

I'm using jQuery.form plugin to .ajaxSubmit() between div's popping in and out of view (for logging and sometimes validation purposes). The user can navigate forward and backward. Some of the div's have full form data, in which case I would use the form's parent div as target:. However, the other div's contain text and navigation buttons...

Javascript link, ajax, jquery, cursor is a text editor not a hand/finger and even though the code has worked it always returns the error result.

This is getting really confusing now... Updating a mysql database without leaving the page.... I have 3 bits of code. The javascript in the head tags, the action button in the body and the code to be performed on another page. Here are the three sections: <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text...

How to make a Google mashup, allowing multiple users to pinpoint multiple locations on a map?

I need some inputs on how to show a map (public to all) and allow any user (whose email I should be able to track) to click several points on the map and make appropriate markers (it should just be visible as a point, nothing special). Other users SHOULD see those points as well. I should be able to access data on the backend as to who s...