John Hesch

Echoing my thoughts and interests

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

JavaScript:
  1. $objResponse->addReplace("title", "innerHTML", "<h2>Enter Order Information</h2>", "<h2>Transaction Summary</h2>");

The expected result would be the HTML tag and text,

HTML:
  1. <h2>Enter Order Information</h2>

would be replaced with

HTML:
  1. <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.

JavaScript:
  1. $objResponse->addClear("title", "innerHTML");
  2. $objResponse->addAssign("title","innerHTML", "<h2>Transaction Summary</h2>");

Simple, eh?

Comments are closed.

Graytone | Design: Tenant Report