Ok, here it goes an example.
Put the jxtools.js
Say you want to replace the above. Well, you will have to replace "a little" more, the enclosing HTML element, that is
dt#active_topics > div.list-inner
You would have to add something like the below code in an appropriate event in viewforum_body.html
if the replacement code is generic (does not depend on the topicrow loop), or
if it is dependent on the topicrow loop.
Code: Select all
<!-- IF not $INCLUDED_JXTOOLSJS -->
<!-- INCLUDEJS lib/jxtools.js -->
<!-- DEFINE $INCLUDED_JXTOOLSJS = true -->
<!-- ENDIF -->
<div id="my_list_inner_hidden_container" style="display:none;" jxdom-target="dt#active_topics > div.list-inner" jxdom-action="replace">
<div class="list-inner">Your modified statements go here</div>
Note that the hidden container could be generic (as in the example above) or loop-dependent, by changing the div id to be unique (different per topicrow), so you may want to add S_ROW_COUNT to the id...
Basically, what you are saying here is that:
- Load the library if not done already
- Create a hidden element that holds the "new" structure
- In that hidden element, specify the action ('replace') to perform on the target DOM element (or elements if the selector matches more than one object:
dt#active_topics > div.list-inner)
- The library finds the DOM target element, and performs the action specified, with the contents of the hidden element, no further action needed
Take a look at the library to see what other options you may use.
This is jQuery based, so no extra library to load (the jxtools lib is extremely small).
Test it, and let me know what you think,