[eluser]spamguy[/eluser]
[quote author="Randy Casburn" date="1225051506"]That was my thought initially too Colin. When I had this problem with AJAX I thought I recalled it was because I was setting the $data variable in the __contstruct() method and calling the setter() method directly that used $this->data. As spamguy described, when called with an HTTP request it would work fine, but with an XMLHttpRequest it wouldn't. I ran up against a deadline, moved the variable to the setter() method for $data and it worked.
That supports your hypothesis. I'd be curious to know "the rest of the story" as Paul Harvey says.
Randy[/quote]
Sorry for the delay in getting back to this question.
You both are technically right: there is more code than I previously showed. However, I commented it all out and tested before posting it here.
As I double-checked my work just now, the solution to this mess hit me. And it's shamefully simple. I have two controllers that use the same private function: 'view' calls it once, 'random' calls it 10 times. 'random' has its own jQuery tab; 'view' does not. Trouble is, $data['myval'] was defined in 'view' but not in 'random'. So for months --
literally months! -- I had myself believing that jQuery was causing PHP variables to die, since undefined variables only happened when jQuery was around.
D'oh.