Search Results

Search found 8063 results on 323 pages for 'ajax'.

Page 20/323 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • JQuery.ajax success function returns empty

    - by viatropos
    I have a very basic AJAX function in JQuery: $.ajax({ url: "http://www.google.com", dataType: "html", success: function(data) { alert(data); } }); But the data is always an empty string, no matter what url I go to... Why is that? I am running this locally at http://localhost:3000, and am using JQuery 1.4.2. If I make a local response, however, like this: $.ajax({ url: "http://localhost:3000/test", dataType: "html", success: function(data) { alert(data); } }); ...it returns the html page at that address. What am I missing here?

    Read the article

  • jquey ajax upload file in asp.net mvc

    - by CoffeeCode
    i have a file in my view <form id="upload" enctype="multipart/form-data"> <input type="file" name="fileUpload" id="fileUpload" size="23" /><br /> </form> and an ajax request $.ajax({ url: '<%=Url.Action("JsonSave","Survey") %>', dataType: 'json', processData: false, contentType: "multipart/mixed", data: { Id: selectedRow.Id, Value: 'some date was added by the user here :))' }, cache: false, success: function(data) { } }); but there is no file in the Request.Files. Whats wrong with the ajax request?

    Read the article

  • Ajax Fancy Capture in CakPHP

    - by Constantin.FF
    I have found a nice ajax capture which i would like to use in a CakePHP framework website. The plugin can be found here: http://www.webdesignbeach.com/beachbar/ajax-fancy-captcha-jquery-plugin What I have tried: in the controller: public function index($slug = null, $capture = false) { if($capture AND $capture =="get_capture"){ $rand = rand(0,4); $_SESSION['captcha'] = $rand; echo $rand; die; } if (!empty($this->data) && $_POST['captcha'] == $_SESSION['captcha']) { .... save the post } } in the view: $selectURL = " $(function() { $('.ajax-fc-container').captcha({ borderColor: 'silver', captchaDir: 'http://localhost/img/capture', url: 'http://localhost/contacts/index/contacts/get_capture', formId: 'MessageIndexForm', }); });"; $this->Html->scriptBlock($selectURL, array('inline' => false)); also I have tried with url: 'http://localhost/js/capture.php' which is the original file coming with the plugin but still not working.

    Read the article

  • AJAX calls from multiple browser tabs at the same time:

    - by Bindi
    When an user tries to send AJAX requests simultaneously from multiple browser tabs, the earlier requests get completed and the page loads but the other AJAX calls are preempted. AS a result of which the response is empty for the other calls. Only one call survives. In my application using struts 2.0, JSP and javascript and the prototype framework, i found that the server response is empty in the cases mentioned above though the data gets updated in teh database with the request parameters. The onSucess event handler for Ajax.request gets called but the the response is empty. Can you please help? Thanks

    Read the article

  • Make element visible on ajax in JSF2

    - by amorfis
    I have dataTable in my page. Initially I want it to be hidden, and show after fetching data by AJAX request. I know how to fetch data and put into table, but I don't know how to show table if it is hidden. Here is the code: <h:commandButton value="aa"> <f:ajax execute="from to validTo" render="transportOffers"/> </h:commandButton> <p:dataTable id="transportOffers" value="${cargoOffer.transportsForCargo}" var="transport"> <p:column> <h:outputText value="${transport.company}"/> </p:column> </p:dataTable> Table is visible initially, even if it is empty. If I set rendered="false" it is invisible, and remains invisible also after AJAX request. How can I make it hidden initially, and to show up after populating with data?

    Read the article

  • Drupal. Use AJAX to update view's content

    - by ozke
    Hi, I've created a view in Drupal that retrieves a list of nodes. The display of this view is a page and it works perfectly well. It does even allow me to filter its content by argument. See the current's view configuration (click to enlarge): I want to use AJAX to use the filter (by parameter) functionality without reloading the page. I've enabled the "Use AJAX" option but I am not sure on how to continue. Any ideas on how to do that? By the way, I'm building my own theme (in case that changes anything). Thanks in advance Update: Basically, this view works when I browse through section/parameter1, section/parameter2... but I want to do the same with AJAX, without reloading the page. I hope is clearer now

    Read the article

  • Pass dynamic data to mvc controller with AJAX

    - by Yustme
    How can I pass dynamic data with an AJAX call to an MVC Controller? Controller: public JsonResult ApplyFilters(dynamic filters){ return null; } The AJAX call: $(':checkbox').click(function (event) { var serviceIds = $('input[type="checkbox"]:checked').map(function () { return $(this).val(); }).toArray(); //alert(serviceIds); $.ajax({ type: 'GET', url: '/home/ApplyFilters', data: JSON.stringify({ name: serviceIds }), contentType: 'application/json', success: function (data) { alert("succeeded"); }, error: function (err, data) { alert("Error " + err.responseText); } }); //return false; }); Ideally would be that the filters would contain the serviceIds as a property For example like this: filters.ServiceIds. I got another filter for a date range and that one would be added like so: filters.DateRange. And server side get the filter as a dynamic object in the ApplyFilters()

    Read the article

  • Jquery .Ajax error when trying to POST data in ASP.NET MVC

    - by GB
    I am unable to access an action in my controller using .ajax. The code works on my development machine but as soon as I place it on the server it gives the error 401 Unauthorized. Here is a snippet of the code in the .aspx file... var encoded = $.toJSON(courseItem); $.ajax({ url: '<%= Url.Action("ViewCourseByID", "Home") %>/', type: "POST", dataType: 'json', data: encoded, //contentType: "application/json; charset=utf-8", success: function(result) { Update: The only time this doesn't work is when I pass json data to the Ajax call, it works fine with HTML data.

    Read the article

  • CakePHP: Ajax view problem (nothing in the view showing)

    - by Adim
    I created a function in my controller called addToPlaylist($songName). I wanted to add these song names to an array and then a session variable using an Ajax call. The first time i did this i got an error saying i do not have a template file to display in the chosen div ("add_to_playlist.ctp was missing"). I created this file and everything seemed to be working correctly. Basically I went to bed woke up and it is broken (it is possible I changed something before I went to bed). The problem now is that it does not show anything when i click the ajax link. when i click on the ajax link it seems to call the function but nothing displays in the view (except debug info) even when i delete the view (add_to_playlist.ctp) i get no errors, I just see debug info now.

    Read the article

  • jQuery 1.4.2 - Ajax & increasing IE 8 Process Handles

    - by mac866
    Hi, I'm requesting every second some data over $.ajax. $.ajax({ type: "POST", url: "ServiceEndpointUrl", data: "", success: function(result) { ... Do Work ... } } } } }); This code leads into an continuous growing number of handles in IE 8 (Windows 7 / verified with Task Manager & Process Explorer). Firefox & Chrome does not have this problem. This page is displayed all day long - this leads into thousands of handles & will sometimes crash the complete browser. My workaround is to reload the complete page every hour - but this can't be the solution ;-) Any suggestions how to "close" these Ajax-Handles? thx

    Read the article

  • Get value from ajax-loaded form before submitting

    - by ldvldv
    Hi, I have an app that loads an ajax form when a button is clicked. I then want to check a value in that ajax loaded form called "comment_content" so that I don't send an ajax request if the comment_content is empty. I can capture the form submission using the live method, however, I can't capture the form element because it needs an element. I was looking at livequery but was wondering if there is a more efficient way by using live or if that I shouldn't even bother? Your help is very much appreciated. $("#comment_submit").live('click', function(){ var comment = $("#comment_content").html(); if(comment == ""){ $("#notice").html("").stop(true, true); $("#notice").append("<p>Are you going to write something in that comment?</p>"); $('#notice').slideDown().delay(2000).slideUp(); return false; } return true; });

    Read the article

  • IE8 + Jquery ajax call giving parsererror from dJango : for json data which seems valid in Firefox

    - by PlanetUnknown
    The ajax call works fine in FF. the data returned is in JSON here is an example from FF firebug - {"noProfiles": "No profiles have been created, lets start now !"} When I try to print the error in IE8 (& in compatibility modes as well), it says "parsererror". But the output seems to be valid JSON. Here is the ajax function call I'm making. Any pointers would be great ! $.ajax({ type: "GET", url: "/get_all_profile_details/", data: "", dataType: "json", beforeSend: function() {alert("before send called");}, success: function(jsonData) { alert("data received"); }, error: function(xhr, txt, err){ alert("xhr: " + xhr + "\n textStatus: " + txt + "\n errorThrown: " + err); } }); The alerts in the error function above give - xhr:<blank> textstatus:parsererror errorThrown: undefined Any pointers would be great ! Note : jquery : 1.3.2

    Read the article

  • Bookmarkabale ajax calls with MVC routing

    - by devzero
    I have a page with a menu that uses JQuery AJAX calls to populate the page with. To reflect any changes I update the URL with a #... instead of ?... or /... So an URL that originally reads : htpp://localhost/pages/index/id=1 would look like : http://localhost/#pages/index/id=1. If a user bookmarks this, and later comes back to the page, I wonder if it's possible to use the second URL in my route decoding, or if I have to load it blank, then use the same JS/Ajax to populate the page? In my mind it is problematic to use Ajax in these cases if a user copies the link and mails it to a friend with JavaScript disabled. edit#1: Fixed some spelling.

    Read the article

  • Django - Empty session data in ajax requests

    - by ninja123
    Hi guys, I have an ajax view where I want to set a session variable like such: def upload(request, *args, **kwargs): request.session['test'] = 'test' request.session.modified = True print request.session.items() I have another normal view something like this: def advertise(request): print request.session.items() I get these two strings printed to shell: [('test', 'test')] [('_auth_user_backend', 'django.contrib.auth.backends.ModelBackend'), ('_auth_user_id', 26L)] Why is the session data that I set in the ajax view not passing to my regular views? If I set session data in regular view, everything works as fine, but it seems that ajax requests contain empty session data? Anybody dealt with something like this before? Any suggestions are greatly appreciated. Thanks.

    Read the article

  • Servlet mapping for ajax call parameters

    - by Woho87
    Hi guys! <servlet-mapping> <servlet-name>Test</servlet-name> <url-pattern>/GetContacts*</url-pattern> </servlet-mapping> I got a simple problem where I can't find any solution on the internet. I have a ajax calls that have the url http://localhost:80/Push/GetContacts?id=23..... The above servlet mapping is not correct for the AJAX call. it issues a http 404 not found call. What is the right syntax to enable my ajax call?

    Read the article

  • $(ajax) using webservice response

    - by loviji
    Hello, I have a simple ajax query. $(document).ready(function () { var infManipulate = true; var tableID=<%=TableID %>; var userName="<%=CurrentUserName%>"; $.ajax({ type: "POST", url: "../../WS/Permission.asmx/CanManipulate", data: "tableID=" + tableID + "&userName=" + userName + "", success: function (msg) { //**how can I know there method CanManipulate returned true or false?** msg; debugger; }, error: function (msg) { } }); And simple web-method [WebMethod] public bool CanManipulate(int tableID, string userName) { //some op. return prm.haveThisMatch(userName, tableID, "InfManipulate"); } how can I know there method CanManipulate returned true or false value in $(ajax) content?

    Read the article

  • How to get session variables from php server with Ajax function? (PHP HTML JS Ajax)

    - by Ole Jak
    so in my php I have something like this $_SESSION['opened'] = true; But It will not be set to true until user will perform some actions with some other html\php pages So I need on some Ajax function to be able get this session variable. And some PHP sample of function to get variable in form ready for Ajax to get it. so I need something to AJAX requesting to an action (to some simple php code) which will return a value from $_SESSION. How to do such thing?

    Read the article

  • Poll database using jQuery/Ajax

    - by Gav
    Hi guys, I am trying to use jQuery (latest version) & ajax to poll a mysql db every x seconds, post.php does a simple search query on the table and limits to 1 row. (eg SELECT id FROM TABLE LIMIT 1) I've got some other jQuery UI (using v1.8) code that displays some modal/dialog boxes on the screen, simply put if post.php returns something from the db I need to initialise the dialog to pop up onto the screen. I've done all the popup stuff I am just having issues joining all these bits together - i've added some pseudo code of how i expect this to work. Thanks in advance var refreshId = setInterval(function(){ $.ajax({ type: "POST", url: "post.php", data: "", success: function(html){ $("#responsecontainer").html(html); } }); }, 2000 );s /* proposed pseudocode */ if (ajax is successful & returns a db row to #responsecontainer) { show jQueryUI modal (done this bit already fortunately) }

    Read the article

  • Jsonp cross-domain ajax

    - by Guillaume le Floch
    I'm working on an application which use ajax call to get html from the server. When I run it on the server, everything works fine. But when I'm running on a localhost, I've a 'Access-Control-Allow-Origin' error. I looked arround and it seems like using jsonp could be the solution. So, my ajax call looks like that: $.ajax({ url: url, dataType: 'jsonp', crossDomain: true, type: 'GET', success: function(data){ // should put the data in a div }, error: function(){ //do some stuff with errors } }); I get html from the server, but I always have this error: Uncaught SyntaxError: Unexpected token < Is there a way to wrap the jsonp response in html? Thanks!

    Read the article

  • Problem with Google AJAX Search API RESTful interface

    - by robert_d
    When I send the following query http://ajax.googleapis.com/ajax/services/search/local?v=1.0&q=coffee%20New%20York%20NY using c# WebClient.DownloadString function or ordinary web browser I get JSON data which is different from data for the same query using JavaScript and Google AJAX Search API. From REST service I get the following url field http://www.google.com/maps/place?source003duds0026q003dcoffee0026cid003d13245583795745066822 but from JavaScript query I get this url field http://www.google.com/maps/place?source=uds&q=coffee&cid=13245583795745066822 The problem with REST service answer is that the url it gives points to a web page with error message "We currently do not support the location". What am I doing wrong?

    Read the article

  • Can't echo jquery (with ajax) variable in php

    - by Lars Kerff
    I'm trying to post a variable through ajax. But it won't echo the variable in php. This are the variables (these are working, seen in the log): $("#slider").bind("valuesChanged", function(e, data){console.log("min: " + data.values.min + " max: " + data.values.max);}); The Ajax part: $("#slider").bind("valuesChanged", function (e, data) { $.ajax({ type: "POST", dataType: "text", url: "../test.php", data: { minValue: data.values.min, maxValue: data.values.max }, async: false, success: function(data){ alert('yeah') }, error: function(xhr) { alert('fail') // if your PHP script return an erroneous header, you'll land here } }); }); </script> And php echo: <?php if ( $_POST ) { echo $_POST[ 'minValue' ]; } ?> Now why does it not echo the post? Thanks!

    Read the article

  • How can I get my div id to reload via ajax and jquery

    - by Matt Nathanson
    I'm creating a CMS using jQuery and AJAX. When I click, my "Add Campaign" buttom, it creates a unique client ID in the DB and on a hard reload, the new client shows up in its container. I am trying to use ajax to reload the container on the fly and I'm not having the exact luck i am hoping for. I can get it to reload, but it's like it's pulling in descriptions of each of the clients as well! function AddNewClient() { dataToLoad = 'clientID=' + clientID + '&addClient=yes'; $.ajax({ type: 'post', url: '/clients/controller.php', datatype: 'html', data: dataToLoad, target: ('#clientssidebar'), async: false, success: function(html){ $('#clientssidebar').html(html); }, error: function() { alert('An error occured!'); } }); };

    Read the article

  • Reload AJAX data every X minutes/seconds, jQuery

    - by NightMICU
    Hi everyone, I programmed a CMS that has a log of who has recently logged into the system. Presently, this data is fed into a jQuery UI tab via Ajax. I would like to put this information into a sidebar on the main page and load it via AJAX every 30 seconds (or some set period of time). How would I go about doing this? Does the PHP response need to be JSON coded? I am fairly new to AJAX and JSON data. Here is the PHP I am currently using to pull details from the users table- <?php $loginLog = $db->query("SELECT name_f, name_l, DATE_FORMAT(lastLogin, '%a, %b %D, %Y %h:%i %p') AS lastLogin FROM user_control ORDER BY lastLogin ASC LIMIT 10"); while ($recentLogin = $loginLog->fetch()) { echo $recentLogin['name_f'] . " " . $recentLogin['name_l'] . " - " . $recentLogin['lastLogin']; } ?> Thanks!

    Read the article

  • Can headers be sent in an AJAX request?

    - by sombe
    Can I call the server to set a new cookie with an AJAX request (that is, after the page has already loaded)? For example, when a visitor hits a link, ajax would open a php file that sets a new cookie like this: setcookie('cookiename', 'true', time()+3000, "/",'...'); But this is done after the html (the page containing the actual <a> tag pressed) was rendered. Is it nevertheless ok to set cookies in ajax? (maybe because the php file loaded is separate from the original html page).

    Read the article

  • Paths when both including and requesting AJAX

    - by Cristian
    I was wondering if there is a way of making a relative path to the main folder (where the index.php lies) from every file that needs to be included or requested by AJAX. I want to combine both AJAX and PHP include so first time the page loads with PHP, and then to be able to refresh parts of the page with AJAX, but the files are the same and lie in subfolders. I'm having problems with the path and although I can set an absolute path, then I have to change it every time the server changes. I want a relative path to where my project is, but not DOCUMENT_ROOT, because that one doesn't work with aliases. (or do you know how to make it work with aliases? ) Thanks !

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >