@@ -98,10 +98,10 @@ public function it_can_generate_table_html_and_scripts()
98
98
$ this ->assertEquals ($ expected , $ table );
99
99
100
100
$ script = $ builder ->scripts ()->toHtml ();
101
- $ expected = '<script type="text/javascript">$( function(){window.LaravelDataTables=window.LaravelDataTables||{};window.LaravelDataTables["foo-table"]=$("#foo-table").DataTable({"serverSide":true,"processing":true,"ajax":"","columns":[{"data":"foo","name":"foo","title":"Foo","orderable":true,"searchable":true},{"data":"baz","name":"baz","title":"Baz","orderable":true,"searchable":true}]});});</script> ' ;
101
+ $ expected = '<script type="text/javascript">document.addEventListener("DOMContentLoaded", function(){window.LaravelDataTables=window.LaravelDataTables||{};window.LaravelDataTables["foo-table"]=$("#foo-table").DataTable({"serverSide":true,"processing":true,"ajax":"","columns":[{"data":"foo","name":"foo","title":"Foo","orderable":true,"searchable":true},{"data":"baz","name":"baz","title":"Baz","orderable":true,"searchable":true}]});});</script> ' ;
102
102
$ this ->assertEquals ($ expected , $ script );
103
103
104
- $ expected = '$( function(){window.LaravelDataTables=window.LaravelDataTables||{};window.LaravelDataTables["foo-table"]=$("#foo-table").DataTable({"serverSide":true,"processing":true,"ajax":"","columns":[{"data":"foo","name":"foo","title":"Foo","orderable":true,"searchable":true},{"data":"baz","name":"baz","title":"Baz","orderable":true,"searchable":true}]});}); ' ;
104
+ $ expected = 'document.addEventListener("DOMContentLoaded", function(){window.LaravelDataTables=window.LaravelDataTables||{};window.LaravelDataTables["foo-table"]=$("#foo-table").DataTable({"serverSide":true,"processing":true,"ajax":"","columns":[{"data":"foo","name":"foo","title":"Foo","orderable":true,"searchable":true},{"data":"baz","name":"baz","title":"Baz","orderable":true,"searchable":true}]});}); ' ;
105
105
$ this ->assertEquals ($ expected , $ builder ->generateScripts ()->toHtml ());
106
106
}
107
107
0 commit comments