ajax

Getting content from a phpfile every X seconds with jquery?

Is this possible? I need to get some data from another phpfile and I want it to appear every X seconds without you having to refresh the page. ...

How to get this ajax drop-down selector to work across all browsers?

I wrote this code that populates a <select> box with the results of an ajax call... (function() { var cache = {}; var queue = {}; $('select.country').live('change', function() { var $countrySel = $(this); var $provSel = $countrySel.closest('tr,.label-and-input').next().find('select.province'); var $p...

How to get the url for a ajax page?

I'm pretty new to ajax and I applied it succesfully to a Drupal site. But I was wondering, how do I get an URL to a page where part of the content is loaded through ajax. Is this even possible? The JSON object is retrieved on click, so how do I make it work when retrieving a certain URL? I realize this is a very broad questionany, any h...

php sessions using ajax

hi im trying to write an enquiry form in php where it gets values from a session array.. but ive cant think how to start.. what im thinking is say for example ive got a page with items on and i click add to enquiry list it will then post it to the enquiry page using ajax? can anyone give me a push start? cheers ...

Ajax submit makes a full post after first submit

The first submit works as expected, but the next time it's fully posted back. I'm using jQuery.form plugin, specifically the .ajaxSubmit(options) call to submit the form. There are a couple levels of wrapper div's, but I debug the button.click binds and I can't figure out why the second time, even with the same variables, it does a full ...

jQuery - getting attribute from HTML Text - IE not working

I'm using and $.ajax method to get an html text. I would like to parse this html, getting the "src" from an "img" tag. I've done this way: $.ajax({ type: "GET", url: "image1.html", success: function(msg){ var htmlCode = $(msg).html(); var title = $("#immagine", htmlCode).attr("src"); ...

anti-CSRF token and Javascript

I'm trying to protect an application (php and lots of JS) from CSRF. I want to use tokens. A lot of operations are done with AJAX, so I have to pass the token in Javascript. If I want to generate 1 token per session or per page load it's simple - I generate new token, put it somewhere in a DOM and then find it with Javascript and send ...

Search using LIKE Clause Mysql

I'm tring to convert a Mysql query to using a LIKE clause and I can't make it work. $query = "SELECT id,name FROM `hin` WHERE name = '".$q."'"; What I've tried in some variations. $query = "SELECT id,name FROM `hin` WHERE name LIKE %'".$q."'%"; I need the query to select row only on string match. Intend is to use variable as needle...

AJAX inconsistency in IE 8??

This is my code: (rather, the dodgy part thereof) if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari var requisicao=new XMLHttpRequest(); } else { var requisicao=new ActiveXObject("Microsoft.XMLHTTP"); } Ok. Sometimes this works fine, but sometimes the Javascript Debugger in IE tells me this: Obje...

Can I Change the value of a textbox with Ajax

Hello, I just started in Ajax today and the tutorial i was reading showed me how to use the result to change a div. But is it possible that i can get the result and make it the new value of a text box. This way i can still edit the text box but the current value will be the ajax result. Right now i am changing the div with this line: d...

Ajax call from local html page in Webkit Qt

I'm trying to perform an Ajax/XMLHTTPrequest from within a local HTML file in QT 4.7RC QWebview. It consistently fails with an empty responseText and status 0. I've set the follwing page->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true); but it has no effect (I can load remote images without problems thoug...

ASP.NET MVC - time ajax request

Hi, I'm using a jQuery modal dialog to display a 'Please Wait' type message to a user when a ajax call is made back to the server. I'm doing this by making the dialog visible using the jQuery ajaxSend method. And I close the dialog using the jQuery ajaxComplete method. All fairly routine stuff I'm sure. However if the call takes a ve...

jquery dialog ajax load

I am trying to load a form into a jquery dialog via ajax and I notice that for some reason in firebug, the request url contains soem bogus parameter..like.._=1283928792723, which causes the request to fail with a 406 not acceptible. Interestingly enough this does not happen with other routes such as edit_user_path(current_user), but it ...

2 same (function,class) name "Ajax" in prototype

In the project I am working on uses established and then used in many parts function Ajax (recvType, waitId) I want to use the "prototype framework" it have class Ajax it is better to do and where to change ? or change in prototype and afte using another name instead Ajax some else name? Or change in all project ? or is there a way ...

How can I prevent XMLHttpRequest to cache requests without jQuery?

I have an webapplication which refreshs a table each minute from a xml-file. When I edit the content of the xml-file, the log of the script shows a "304 Not Modified"-Message when it try to get the current file. But the file is edited. If i refresh the xml-file http:/xx.de/test.xml in the browser, the webapplication also shows the edit. ...

AJAX XML tree without server-side language.

I need to make a nodes tree from data.xml file (as here link text) with AJAX. Is it possible to do this without the server programming language? I can get the whole data.xml file (all nodes) - but I need to load nodes dynamically (depending on the current tree view). ...

PHP problem with UTF-8

Hello, first sorry for my English. I will try to explain me. I am delevoping a web to edit a SoapUI(webservices) XML project. In this web, when someone change a response, the response is sent by Ajax by post. I take the response and the first action is an utf8_decode, then I do some str_replace. Everything perfect, I've got this (in va...

creating a associative array/hash in javascript

Hi I have a form with different groups of checks boxes and trying to pass all the selected values into an array then pass that data into a ajax request. $('#accessoriesOptions input').each(function(index, value){ if($(this).attr('checked') ){ var newItem =[]; var obj = {}; obj[$(this).attr('value')] = $(this)...

Ajax callback refresh div

Hello All, I implemented a Ajax callback function to update a div (announcement) in my web page. It works fine, but the current issue is that the Ajax call function update the announcement div, however, after rewrite the content, the Javascript functions in this content are not load it. Therefore, my toggle function in table does not...

PHP isn't saving session when it's an ajax call...

Hi all, i'm testing out a service for internal ads on our website... I need to save internal session (PHP) to know what ads have been displayed and some other protection stuff... The problem is that if i access to the API throught webbrowser GET or POST it does session (and saves the cookie of php session), but if i use jQuery.ajax() ...