MDL-68148 output: type attribute is unnecessary for javascript resources

This commit is contained in:
Shamim Rezaie
2020-04-08 11:44:28 +10:00
parent 351262b192
commit cabbb145dd
2 changed files with 4 additions and 6 deletions
+2 -4
View File
@@ -2089,12 +2089,10 @@ class html_writer {
*/
public static function script($jscode, $url=null) {
if ($jscode) {
$attributes = array('type'=>'text/javascript');
return self::tag('script', "\n//<![CDATA[\n$jscode\n//]]>\n", $attributes) . "\n";
return self::tag('script', "\n//<![CDATA[\n$jscode\n//]]>\n") . "\n";
} else if ($url) {
$attributes = array('type'=>'text/javascript', 'src'=>$url);
return self::tag('script', '', $attributes) . "\n";
return self::tag('script', '', ['src' => $url]) . "\n";
} else {
return '';