WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 20 months 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:

Description

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
6 years ago

  • Component changed from General to Script Loader

Related: #22249

#2 @wonderboymusic
5 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.


20 months ago

Note: See TracTickets for help on using tickets.