Skip to content

Commit a2c334f

Browse files
The attributes parameter is never used.
I was following the Quick Starter and it always gave me the jquery(ReferenceError: $ is not defined) error. when we used this code( {{ $dataTable->scripts(attributes: ['type' => 'module']) }} ) , the type was always type="text/javascript" not 'module' as expected.
1 parent 47d1848 commit a2c334f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Html/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function scripts(string $script = null, array $attributes = ['type' => 't
104104
{
105105
$script = $script ?: $this->generateScripts();
106106
$attributes = $this->html->attributes(
107-
array_merge($attributes, ['type' => static::$jsType])
107+
array_merge($attributes, ['type' => $attributes['type'] ?? static::$jsType])
108108
);
109109

110110
return new HtmlString("<script{$attributes}>$script</script>");

0 commit comments

Comments
 (0)