Search Results

Search found 8271 results on 331 pages for 'ajax beginform'.

Page 77/331 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • JQuery $.ajax doesn't return anything, but only in Google Chrome!?

    - by Shawson
    Hi All, I'm hoping someone can help me with this as I'm at a loss. I'm trying to simply load a plain text file into a page at runtime using jquery- everything works fine in IE8 (8.0.7600.16385), Firefox 3.6.3, however in Google Chrome 5.0.375.55 the "data" comes back as nothing- i get an empty alert box. This is the code i'm using; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Animation Test</title> <script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function () { $.ajax({ url: 'level1.txt', success: function (data) { alert(data); }, async: true, type: 'GET' }); }); </script> </head> <body> <canvas id="canvas" width="640" height="480"> Unsupported Browser </canvas> </body> </html> The file I'm loading in is a plain text file containing this; Central Cavern 100 O.........1.C....C...........1.O O................1.............O O..............................O O..............................O O......................B1..B...O O=============~~~~=~~~~========O O.............................1O O===...........................O O............A..OOO.B..........O O====...<<<<<<<<<<<<<<<<<<<<...O O............................==O O..............................O O..........B........OOO.....===O O....===============...........O O%............................XO O==============================O (Yes- it's the first level from Manic Miner! I'm making a javascript version using the html5 canvas to get my head around using it.) I'm at a total loss- it can't be the code because it runs in the other 2 browsers- is there an issue with jquery and this version of Chrome? Thanks for reading!! Shaw.

    Read the article

  • Ajax/PHP - should I use one long running script or polling?

    - by Brian
    Hello, I have a PHP script that is kicked off via ajax. This PHP script uses exec() to run a separate PHP script via the shell. The script that is called via exec() may take 30 seconds or so to complete. I need to update the UI once it is finished. Which of these options is preferred? a) Leave the HTTP connection open for the 30 seconds and wait for it to finish. b) Have exec() run the PHP script in the background and then use ajax polling to check for completion (every 5 seconds or so). c) Something else that I haven't thought of. Thank you, Brian

    Read the article

  • How can I detect 'any' ajax request being completed using jQuery?

    - by Brian Scott
    I have a page where I can insert some javascript / jquery to manipulate the output. I don't have any other control over the page markup etc. I need to add an extra element via jquery after each present on the page. The issue is that the elements are generated via an asynchronous call on the existing page which occurs after $(document).ready is complete. Essentially, I need a way of calling my jquery after the page has loaded and the subsequent ajax calls have completed. Is there a way to detect the completion of any ajax call on the page and then call my own custom function to insert the additional elements after the newly created s ?

    Read the article

  • Is there a better way to serially submit multiple AJAX requests?

    - by friedo
    I have a page with multiple forms that I submit via Ajax POSTs serially. At first, I tried using synchronous XHR requests, but this causes the browser to lock up for the duration of the request, and breaks my DOM-manipulation effects, which is unacceptable. So the pattern I ended up using is basically this: var fcount = 0; // incremented for each form to be submitted function submit_form( num ) { var fdata = { ... }; // data from form # num $.ajax( { async: true, url: '/index.cgi', data: fdata, type: 'POST', success: function() { if ( num < fcount ) { submit_form( ++num ); } } } ); } $( '#submit_form_btn' ).click( function() { submit_form( 1 ) } ); The recursion strikes me as a bit of an ugly solution to what is essentially an iterative problem. Is there a cleaner or more elegant way that this could be handled?

    Read the article

  • using an existing object in ajax-called php files?

    - by noname
    i have in my index.php created an object and set some property values. then i use jquery ajax to call some php files and i want to use the object created. i tried this one but it didn´t work: ---- in index.php ---- // Create a new object session_start(); $object = new stdClass(); $object->value = 'something'; $object->other_value = 'something else'; // Save the object in the user's session $_SESSION['object'] = $object; ---- Then in the next page that loads from AJAX ---- // Start the session saved from last time session_start(); // Get the object out $object = $_SESSION['object']; // Prints "something" print $object->value; how do i accomplish this. cause i dont want to recreate the object in every ajaxcalled php script. thanks in advance!

    Read the article

  • How to store and access ajax data in javascript without using global variables ?

    - by mike_t2e
    I may be missing something obvious here, but how could I rewrite this code so that it doesn't need the theVariable to be a global variable ? <script language="javascript"> theVariable = ""; function setValue() /* called on page load */ { /* make ajax call to the server here */ theVariable = "a string of json data waiting to be eval()'d"; } function getValue() { alert(theVariable); } </script> <input type="button" onClick="javascript:getValue()" value="Get the value"> In my actual situation, the setValue function makes an ajax call to the server, receives a json string and the data from that is accessed when you mouseover various parts of the page. I end up using several global variables which works fine, but is messy and I'd like to know if there's a better and more elegant way of doing it ?

    Read the article

  • How can I access form elements when using an ASP.NET MVC Ajax form?

    - by Patrick
    I've got an ajax form in an MVC 2 application. I cannot find the proper way to access the form elements within the Ajax form decleration. I can access the name of the elements with Request.Form.Keys but I can't access the actual values. I've read numerous examples of posting forms with jQuery but my form has elements created dynamically based on route values (sometimes it could be 2 text boxes sometimes 10, given unique names like so: <%= Html.TextBox("Evaluation"+Model.EvaluationId.ToString())) so I couldn't find a way to make that work with jQuery. Is there another way that I for elements can be accessed?

    Read the article

  • How to integrate history.js to my ajax site?

    - by vzhen
    I have left and right div in my website and with navigation buttons. Let's say button_1, button_2. When clicking on these button will change the right div content using ajax so means the left div do nothing. The above is what I have done but I have a problem here, the url doesn't change. And I found history.js is able to solve this issue but I cannot find any tutorial about history.js + ajax. Can anyone help me out? Thank in adv

    Read the article

  • Display data requested by an ajax.load() call once complete, not during the call.

    - by niczoom
    My jQuery code (using ajax) request's data from a php script (pgiproxy.php) using the following function: function grabPage($pageURL) { $homepage = file_get_contents($pageURL); echo $homepage; } I then extract the html code i need from the returned data using jQuery and insert it into a div called #BFX, as follows: $("#btnNewLoadMethod1").click(function(){ $('#temp1').load('pgiproxy.php', { data : $("#formdata").serialize(), mode : "graph"} , function() { $('#temp').html( $('#temp1').find('center').html() ); $('#BFX').html( $('#temp').html() ); }); }); This works fine. I get the html data (which is a gif image) i need displayed on screen in the correct div. The problem is i can see the html data loading into the div (dependant on network speed), but what I want is to insert the extracted html code into #BFX ONLY when the ajax request has fully completed.

    Read the article

  • why does $.ajax(..) not work for me?

    - by dr jerry
    I'm running jquery from a file. And I'm trying to load a svg file from my localhost to populate a svg canvas. However that does not work as expected. What I do from filesystem: $.ajax({ url: url , timeout: 1000, complete: function(xml) { alert('complete'); }, success: function(xml, status, xreq) { alert('success'); }, error: function() { alert('error'); } }); the url reads: http://localhost/image.svg, when I read this url directly from an addressbar from the browser, the pages remains white but the pagesource displays the source of image.svg. Debugging the $.ajax code above, reveals that the success: method is hit, but xml response remains empty. Any help is greatly appreciated. regards, jeroen.

    Read the article

  • Ajax / GroovyGrails Post data coming over with unexpected leading character. Who is encoding/decod

    - by ?????
    I'm having an encoding issue, and I'm not sure where to look for the problem. I have this Ajax.Request function (prototype library) sending data to a Groovy/Grails encoder var myAjax = new Ajax.Request(url, {method:'post', encoding:'UTF-8', contentType:'application/x-www-form-urlencoded', parameters:{'content':new_content}, onSuccess:success, onFailure:failure}); The data is coming in with an unexpected %A0 at the beginning: I have this simple controller that just echos the content back: def titlechange = { def content = URLDecoder.decode(params['content']) printf("Content: %s; DecodedContent = %s\n", params['content'], content) response.characterEncoding='UTF-8' render content } the debug print statement shows: Content: %A0Hello%2C%20world%21; DecodedContent = †Hello, world! Where is that %A0 coming from? My grails configuration has this: // The default codec used to encode data with ${} grails.views.default.codec="none" // none, html, base64 grails.views.gsp.encoding="UTF-8" grails.converters.encoding="UTF-8 Is the issue on the grails side or on the JavaScript side?

    Read the article

  • JQUERY AJAX, Issues with spaces being sent to the server, y?

    - by nobosh
    I'm using the following code to post to the server which is then sent to a MYSQL query to find matches via search. $.ajax({ url: '/search/spotlight/', data: "q=" + $(this).val(), success: function(data) { } }); When Q's val has spaces in it, it's creating problems. I'm wondering if I'm handling this correctly? Do I need to encode the value in the AJAX call? Or is this a problem on my backend, which is ColdFusion Right now JQUERY is posting the following to the server: /search/spotlight/?q=FirstName%20LastName is this right?

    Read the article

  • any way to use ajax with jstl customtags without duplicating tags in javascript?

    - by CodeMonkeyB
    I am working on a page where part of the content is loaded normally and the pages are rendered using jsps. The product images and links generated on that page are by custom jstl tags. When the user scrolls more products are requested from the server in a JSON response and then using UnderscoreJS templates they are rendered and added to the bottom of the page. Is there any way I can use the JSTL tags in Javascript without recreating them using a javascript function (it won't be possible to re-create all of them in javascript). What is the best way to handle this scenario? I guess I could return a rendered html response for the ajax call, but that would mean I have some ajax requests which use json and some that use rendered html...

    Read the article

  • How do I bind the Overlay Tool for new Ajax elements in Jquery?

    - by Hooman Ahmadi
    Hi, I'm using: echo $javascript->link('tools.overlay-1.0.4', false); which is initialized with: $(".overlay_popup").overlay({ expose: '#000000', close: '.close_overlay', finish: { top: 'center', left: 'center', absolute: false } }); I call the overlay popup box like this: echo $html->link( "add part", array('controller'=>'garage_parts', 'action'=>'addfrompartlist', $gcar['GarageCar']['id'], $gcar['GarageCar']['car_id']), array('class'=>'js-ajax overlay_popup', 'id'=>'add_part_overlay', 'rel'=>'.overlay_container') ); This all works fine and dandy, however I have an ajax function that dynamically adds the "add part" hyperlink button shown above and I have no idea how to bind this new button to the overlay. Normally, I would use something like this: $(".overlay_popup").bind("click", function(){... but this didn't work for the overlay. Any ideas on how I can successfully do this?

    Read the article

  • How do I show the print with AJAX/jQuery?

    - by Doug
    So I'm trying to understand this whole AJAX/jQuery thing. Right now, when I run this PHP script alone, I would have to wait and watch the wheel spin until it's done with the loop and then it will load. while ( $row = mysql_fetch_array($res) ) { postcode_to_storm( $row['Test'] ); $dom = new DOMDocument(); @$dom->loadHTML($result); $xPath = new DOMXPath($dom); $failInvite = 'Rejected'; $findFalse = strpos($result, $failInvite); if ( $findFalse == true ) { $array[$i] = $row['Test']; $i++; echo $array[$i]}; } } Now, how do I use AJAX/jQuery to show echo $array[$i]}; everytime it is invoked instead of waiting for the whole process to complete?

    Read the article

  • Django: How do I go about changing my simple app to use Ajax?

    - by swisstony
    I currently have a web page where the user enters some data and then clicks a submit button. I process the data in views.py and then use the same Django template to return and display the original data and the results. What I would like to do is try to give it a bit more of a modern look and feel. You know the sort of thing, the page doesn't refresh but displays a spinning disk until the results are displayed. I assume this means using Ajax? How difficult is it to modify a simple app like this to use Ajax? What is involved? What are the best tools to use? JQuery?

    Read the article

  • Ajax request with prototype - what is transport if not only responseText?

    - by Delirium tremens
    This is an example code from the prototype site. var url = '/proxy?url=' + encodeURIComponent('http://www.google.com/search?q=Prototype'); // notice the use of a proxy to circumvent the Same Origin Policy. new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { var notice = $('notice'); if (transport.responseText.match(/href="http:\/\/prototypejs.org/)) notice.update('Yeah! You are in the Top 10!').setStyle({ background: '#dfd' }); else notice.update('Damn! You are beyond #10...').setStyle({ background: '#fdd' }); } }); The data that comes from the ajax request is available at transport.responseText, but what is transport if not only responseText?

    Read the article

  • I am using jquery ajax using text() but any html written in the XML doesn't render?

    - by Xtian
    So I have Jquery Ajax working real nice, but an issue I am having is in my XML if I want to bold a work or Italicize a sentence, if I do it in the XML using HTML tags it will not show up. I am pretty sure it is due to using the .text(). Any suggestions on a work around for this? $(document).ready(function(){ $.ajax({ type: "GET", url: "xml/sites.xml", dataType: "xml", success: function(xml) { $(xml).find('site').each(function(){ $(this).find('desc').each(function(){ var brief = $(this).find('brief').text(); var long = $(this).find('long').text(); var url = $(this).find('url').text(); $('<div class="brief"></div>').html(brief).appendTo('#link_'+id);

    Read the article

  • How to show ajax loading gif only for a specific request?

    - by innerJL
    How do you show ajax gif only for a specific request? For example my page is calling a web-service every 30 seconds in a background, and I don't want to show the gif during this callback. On the other hand I want to show the gif, when I'am making manual ajax requests. I am using jQuery. edit: I didn't setup the global handler as shown here http://api.jquery.com/ajaxStart/, just by attaching to the .ajaxStart event. But I don't want to show/hide the gif manually on every request too. I need some generic solution.

    Read the article

  • How to implement CSRF protection in Ajax calls using express.js (looking for complete example)?

    - by Benjen
    I am trying to implement CSRF protection in an app built using node.js using the express.js framework. The app makes abundant use of Ajax post calls to the server. I understand that the connect framework provides CSRF middleware, but I am not sure how to implement it in the scope of client-side Ajax post requests. There are bits and pieces about this in other Questions posted here in stackoverflow, but I have yet to find a reasonably complete example of how to implement it from both the client and server sides. Does anyone have a working example they care to share?

    Read the article

  • Are AJAX calls to a sub-domain considered Cross Site Scripting?

    - by AaronPresley
    I have Server A (www.example.com) sending information to Server B. I can only have HTML / JS on Server A (and have to do the "crunching" on Server B) so I'm trying to send form data via AJAX (trying to avoid a form post to Server B - don't ask). Obviously doing an AJAX call cross-domain is considered XSS and a big no-no, but if I were to put Server B in a subdomain (sub.example.com), would that be considered okay? How are cross-domain errors detected? Does the browser look up DNS records? IP address? Thanks in advance for you help.

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >