Added tag parsing to javascript