ajax

Can Response.Redirect and OnBeforeUnload play nice together?

Does anyone know how to detect in a OnBeforeUnload event that the server side code sent a Response.Redirect? I want to prompt a user to keep them from moving away from a page before it's time, but when the server redirects I it shouldn't prompt the user. I'm working with legacy code that extensively uses Response.Redirect and I'm not i...

Javascript ShareThis Link Disappearing On Postback

Hi, I have a ShareThis (http://www.sharethis.com) link in the footer of my Masterpage. The code they provide generates the link via Javascript. My site is very simple so far (http://www.quotidianword.com), just a place to put your email. But when the email is entered, there is an AJAX postback and the link disappears! Is there any way to...

jQuery Ajax call very slow in IE, but instant in Firefox

I am performing a jQuery .ajax() call that returns a List<string> of IP addresses on a specified subnet. I use a [WebMethod] on an .aspx page to return the values. ASP.NET's built-in JSON serializer does the magic to return the actual JSON used in my Javascript. I have profiled the the server-side time, and it takes about 8 msec to po...

Dynamic UI styling/theming

I'm doing a e-commerce type of website, and it has a CMS wherein the admin user could create themes and change current theme design. I use jquery. the style/theme properties are stored in database and retrieved to an xml. and i use jquery to manipulate the CSS properties of the page using the xml's properties.. is this the practical w...

Pass multiple arrays to javascript via ajax

To pass an array from PHP to javascript via ajax, I am going to use json_encode, and recieve it on the javascript end. However, I will be returning multiple rows from my MySQL database, and need to return multiple JSON-formatted arrays. One way I thought of doing this was to string the JSON arrays together in php with some obscure charac...

Post MySQL Result Using Alax(Jquery).[SOLVED]

Hi all, Im afraid its another noob question...lol. Being relatively new to javascript/ajax/jquery..programming ingeneral... I am fumbling where blind men drive chariots, so please go easy:). I am wanting to post 3 values to the database, 2 of which are results of a mysql query(Im not sure if I am doing this right, so feel free to correc...

Post form in JQuery and populate DIV - broken in IE

I am trying to create a form that posts data via JQuey and populates the return into the same DIV. This way the page does not refresh on post action. <div id="add_value_form"> <form method="POST" action="#" onsubmit='return false'> <!-- input fields --> <input type="submit" value="Add" onclick='post_form("/add_value");'> </form> <...

AJAX table update script

Hey, I'm making an online tile based game and I have just finished scripting the piece of code that takes the coordinates of where you are standing and builds the surroundings (tiles) around you (the game is made using a table with many cells that hold the tiles). I need some help creating a bit of AJAX that can refresh my table every ...

jquery tablesorter + ajax div content update problem

I'm having trouble with my tablesorter and ajax div content update. Once the ajax is reloaded all the tablesorter functionalities are lost. I've tried livequery but it doesn't seem to work beyond first listing of the table. <script type="text/javascript"> $(document).ready(function(){ $(".tabs > ul").tabs(); $("#sort...

Tips for optimising Database and POST request performance

I am developing an application which involves multiple user interactivity in real time. It basically involves lots of AJAX POST/GET requests from each user to the server - which in turn translates to database reads and writes. The real time result returned from the server is used to update the client side front end. I know optimisation ...

MVC - where do you put AJAX scripts?

I am using Kohana but this question applies to Rails, CI, or any other MVC web development framework. Where is the best place to stick one's server side AJAX scripts? I was planning on creating an Ajax_Controller and using a method/action per individual script. For example, a login form on the home page index.php/home would send an XM...

AJAX refresh script

Hey, I have some AJAX that refreshes my page but also makes the div that it is refreshing go up and down as it refreshes but i don't wont it to do that, I just wont it to refresh. How would I edit this code to take out the minimizing and maximizing of the div? var _v = 0; var _v2 = 1; function ajax_update() { var wra...

How can you make a vote-up-down button like in Stackoverflow?

Problems how to make an Ajax buttons (upward and downward arrows) such that the number can increase or decrease how to save the action af an user to an variable NumberOfVotesOfQuestionID I am not sure whether I should use database or not for the variable. However, I know that there is an easier way too to save the number of votes. H...

How do you write a functional / controller test to check for content added via an AJAX call?

Test def test_generateCashFlowStmt get :getDateRangeForCashFlowStmt xhr :post, :generate_cash_flow_stmt, {:fromDate => {:year=>"2009", :month => "3", :day=>"1"}, :toDate => {:year=>"2009", :month => "3", :day=>"31"} } table = [ .... ] assert_equal table, formatCashFlowStatementAsTable( assigns(...

Sending values with jQuery's Get function

I am currently coding something to check my database to check for duplicate errors. It is a form and I am having the following function check for duplicate values using jQuery.get. function makeAjaxRequest() { $("label#bad_error").hide(); $("label#good_error").hide(); $("label#checkingdb_error").show(); $.get(url,{sheetnum...

submit php variables with javascript (link?)

Hey, I'm creating a browser based game and at the moment I'm designing the script that updates the position of my character when he/she clicks on a different part of the map. I am using a bit of ajax to do this which send a request to a php file called position_update.php. But for it to work I need to send two values along with it so i...

Updating database with php and ajax

hey, Below is my script that updates my characters position in my database: <script language="javascript" type="text/javascript"> function positionUpdate(){ var word = document.getElementById('test').value; var queryString = "?word=" + word; ajaxRequest.open("GET", "new_position.php" + queryString, true); ajaxRequest.send(null); alert(...

Problem with AJAX

Hey, I have a problem with my ajax script, I put in some alerts to see where the problem lies, here is my script: <script language="javascript" type="text/javascript"> function positionUpdate(var1, var2){ alert ("1"); var queryString = "?var1=" + var1 + "&var2=" + var2; alert ("2"); ajaxRequest.open("GET", "position_update.php" + query...

How to create "My status" using php and ajax?

As title mentioned, how to create a status bar(like facebook or twitter). User can type in what is he doing now? I believe its using AJAX, but then how to store to database? (I am new to AJAX) For example: User type in "I am eating now", then click the "update" button, then It will update automatically to the status field, displaying th...

What is wrong with my link generated from PHP?

In my code I am just hyperlinking to an anchor tag for a PHP function when I click My code is below, another.php is called by AJAX, index.php from JQuery. another.php <?php echo " <a href='my.php?action=show&amp;id=".$fid."' onclick=\"return display('".$fid."');\"> "; echo "" .$fname."</a> "; ?> The hyperlink does no...