I'm building an online cash register and decided to use XAJAX as my PHP/Ajax toolkit. It was very easy to learn and begin using. In fact, I am amazed at how easy XAJAX is to use. The problem, it is still in the infancy stage and today I found that not all responses work as expected.
I needed to replace an element like this
-
$objResponse->addReplace("title", "innerHTML", "<h2>Enter Order Information</h2>", "<h2>Transaction Summary</h2>");
The expected result would be the HTML tag and text,
-
<h2>Enter Order Information</h2>
would be replaced with
-
<h2>Transaction Summary</h2>
I just couldn't get it to work. It appears that the problem is with Firefox. I didn't try IE but from what others have said, addReplace works in IE.
I finally had to come up with a workaround because I needed this to work in both IE and FF.
-
$objResponse->addClear("title", "innerHTML");
-
$objResponse->addAssign("title","innerHTML", "<h2>Transaction Summary</h2>");
Simple, eh?