ajax

Value resetting when a method is called within the onload

window.onload = init; function init(){ initializeEventHandlers(); getData(formatDate(new Date)); gotoDate('today'); } //scripts that manage the UI for tracker.aspx var dCurrentDate, sCurrentDate, sCurrentDayData, stepsVal, chipsVal, dayValue, dateValue, caloriesVal; var fCurrentValue = 0; var bAnimating, bSliding = false; ...

Why is my jquery ajax requests performing multiple times?

Hi there, I am looking at the console in firebug when I click on a function which performs an ajax request. The problem is, that one click of a button should send 1 ajax request, but I get 2 requests being sent! The code for my js looks like this: $(document).ready(function() { $('.book_now').click(function(){ $.ajax({ type: 'P...

Allowing partial survey completion - when to save to DB

I'm building a simple survey, consisting of several pages with questions that all have multi-choice answers: radio buttons and checkboxes The end result required are records in a MySQL table, one for each answer selected. And we want to make it so that you can quit halfway through and come back later to complete. My first thought was ...

How to fetch multiple return values from a JavaScript function

I have JavaScript function call to changeMapLocation function where in it I want to return the variables lat and long1. I have some problem in code to return those two variables and alert in function call. var sample = changeMapLocation(state); alert(sample.lat1); alert(sample.lat2); function changeMapLocation(state) { var address...

ajax validation with multiple input fields

hi guys, I am working on a new system and am stuck at a point with jquery + ajax. My problem is this, how can i validate multiple fields in my registration form using ajax. I don't want to create a separate validation for each input fields. can you help me guys, please. :-( Thanks a lot. ...

Pros and cons of AJAX-loaded content

Hi guys, It's pretty nice to sort a dataset by a number of filters and get the results shown instantly, right? My solution to do this would be to POST the "filter" (read forms) parameters to a page called dataset.php, which returns the appropriate dataset in compiled HTML, that can be loaded straight into my page. So, besides this bein...

is it possible to disable/enable update panel in differnet conditions?

hi my dear friends : i have some controls for inputing data (with a button for submit them) inside a contorl panel... my submit button code has 2 part (conditional): 1-insert code 2-pop up a RadAlert (Calling a Javascript function From Code Behind - My RadWindow Manger is in Master Page - RadWindow Manager is necessary for showing th...

restricting javascript widgets to certain domains

I need to create a webservice providing javascript widgets and ajax calls, which only run on certain domains. After doing a lot of research, I only came up with a combination of HTTP-Referer and API Keys, which is pretty easy to break with tools like RefControl, or am I missing something? Are there more secure solutions for this problem?...

How to get the return value from a jquery GET request?

I would like to do something like this: function blabla(); var check = blabla(); if(check == 1) But in my blabla function I have a Get request and I have a callback but can't get the return value to be the blablas return value; var checkemail = 0; $.get("bla.aspx", { day: "friday" }, function(data)...

Server polling with JavaScript

What is best practise for polling server with JavaScript for application that needs to refresh data very rapidly? I'm using jQuery for front-end and Java Spring Framework for backend. Example of refreshed data could be list of items that are getting updated very rapidly (every 1 second). ...

jQuery-UI Opacity Effect on Tabs

I'm having some issues using the opacity effect on jQuery-UI tabs... especially in IE Here is my code; $('#featured').tabs({ fx:{ opacity: "toggle" } }).tabs('rotate', 5000, true); Check out http://www.jsfiddle.net/cxNj8/4/ Apart from the effect...

How often can I have ajax ask for new data?

I am working on designing a collaborative system where multiple users can edit the same document, much like googledocs, and I guess 'search suggestions', but in no way as advanced. My question is this, will my design work? I know enough php/ajax to design this, using jQuery for the ajax part. But I have never made such a system, and the...

How can I perform Jquery function during AJAX

I am using Jquery AJAX to post a form on my page. I want to hide a div whilst AJAX is being performed and show it again when AJAX is a success. How can I do this?? Check my code here: $(document).ready(function(){ $("form#microblogpost").submit(function() { // we want to store the values from the form input box, then send via ajax belo...

Use UpdatePanel with GridView

Hi I have a masterpage with a sidebar that conatians an accordion control for site navigation. On one of my child forms I have added a GridView inside an UpdatePanel. This user starts a job via a button click. This job writes to a database table and I'll like to see this updates presented via the Grid view. I've added a timer control wi...

Ajax response with french encoding

Is it possible to make json response with characters in french encoding? IE6 never invoke callback function to handle json response. ...

Reloading new content while scrolling

Im using the following jQuery, which sets the id of the last item in a UL to 'last_item'. function oldest() { j('ul li:last-child').addClass( 'last_item' ); oldestName = j('.last_item').attr('id'); alert('last ID is:'+ oldestName +'.'); } j(window).scroll(function(){ if (j(window).scrollTop() == j(document).height() - j(window)...

Loading content AJAX Jquery - Need to send data to loaded page how???

I have some content on my page that I require to be loaded via ajax. The page that I want to load is requesting some php variables I have stored on the main page. How can I send these variables to the page then load the page via ajax??? Code so far: $('#microblogposts').load('posts.php', {postmessage="+ postmessage +"& from_user="+ fr...

valuehchange listener, ajax

I am using a JSF page in a portal environment. If I use a valueChangeListener, the method is not called in the backing bean unless I use onclick="submit()". This submits my page which I don't want. Same is the case with actionListner. Also, if I use ajaxRefreshSubmit, my whole page is submitted rather than submitting the specified part ...

Can the unload Event be Used to Reliably fire ajax Request?

I need a method to monitor user edit sessions, and one of the solutions I'm reviewing will have me using an unload event to send an ajax request to inform the server of the end of the edit session. (See: http://stackoverflow.com/questions/3530165/monitoring-user-sessions-to-prevent-editing-conflict) My (rather limited) reading on the un...

jquery ajax call not able to see response data

Ajax response I am getting is always empty! Interestingly, if I copy paste that URL in browser, I do get a proper html snippet (test ad) back. I guess this is related to some cross-site call stuff. Need some help/pointers as response is not json. Its html code. Please look at the code - http://pastie.org/1120352 ...