How to replace comma separated string with bullets in HTML template

If you have a comma separated list and you want to display it in an eBay listing as bullet points you can use the following javascript:

<script type="text/javascript">
function makeBullets(arg1) {
var visitorName = "</li><li>";
var myOldString = arg1;
var myNewString = "<ul><li>" + myOldString.split(",").join("</li><li>") + "</li></ul>";
return myNewString;
}
</script>

Then place the following script where you want the bullets to display in the HTML:

<script type="text/javascript">
var origtext = makeBullets("#?Content?#")
document.write(origtext);
</script>

Comments