Take the 2-minute tour ×

OK, i have this jQuery script using ajax to load a response from a php file, but i want to do is to load maybe two variables from the php script rather than the whole page.

$(document).ready(function() {
    cache: false
   var refreshId = setInterval(function() {

So what i want is to be able to say load variable1 from the php page into object_area, then load variable2 into object_area2 if that makes sense?


share|improve this question
What are these variables? I'm not following here, can you elaborate a bit more, maybe an example? –  Nick Craver Oct 31 '10 at 10:43
Well, this is just for concept rather than a working example, but say in my php i had: $variable1 = "John Smith"; and $variable2 = "Jack The Lad"; but i wanted to grab $variable1 and stick it in object_area and grab $variable2 and stick it in object_area2 –  benhowdle89 Oct 31 '10 at 10:48

1 Answer 1

up vote 1 down vote accepted

What about return your variables in JSON format with the dedicated PHP function ?

(don't forget to properly set the headers)

You could manipulate your variables more simply with JQuery

share|improve this answer

Your Answer


