changed $data['js']

to work with strings and arrays and changed the if statements to the same style as the rest of the framework.