Log in

View Full Version : Parsing in a BB Code


MrApples
12-09-2007, 06:22 PM
I want to create a custom BB code where the param goes through a JavaScript parsing. All my attempts at actually calling the function on the content have failed though.


<script type="text/javascript">
function parseJass(jcode){
jcode = jcode.replace(/function/g, "<b>edited</b>");
return jcode;
}
</script>

<div onMouseover="this.innerHTML = "parseJass('{param}')">
This be a div.
</div>


That worked. But I want it to respond when the page loads, not when mouse is over, how would I do that? Really the problem is I don't know how to get the div element except through "this" (id is not an option).