Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#29893 closed enhancement (maybelater)

Scripts output syntax enhancement for HTML5

Reported by: poxtron Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Script Loader Keywords:
Focuses: Cc:


Hi there, I was wondering why enqueued scripts have the 'text/javascript' type when its no longer necesary in HTML5.

Found the exact part on the code that needs to change, making a filter or using an action is not posible, is on

wp-includes/class.wp-scripts.php line 142 and 144

the only thing thats needs to be done there is remove type='text/javascript' and that's it.

Will not affect existing sites, but it will make the code look more poetic. ;)

Change History (3)

#1 @ocean90
7 years ago

  • Component changed from General to Script Loader

Related: #22249

#2 @wonderboymusic
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

The "type" attribute is required in HTML 4, but optional in HTML5. HTML5 is opt-in via DOCTYPE, someone correct me if I am wrong.

Thanks for the report.

This ticket was mentioned in Slack in #core by swissspidy. View the logs.

3 years ago

Note: See TracTickets for help on using tickets.