[wp-trac] [WordPress Trac] #38255: inclusion of javascript script

WordPress Trac noreply at wordpress.org
Mon Oct 10 01:34:57 UTC 2016


#38255: inclusion of javascript script
-------------------------------------+------------------------------
 Reporter:  nmoral                   |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Script Loader            |     Version:  4.6.1
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |     Focuses:
-------------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => reporter-feedback close


Comment:

 Hi @nmoral and welcome to Trac.

 I'll be honest - I'm not 100% sure on what you're asking for here.

 > When I was working on my themes. I tried to include scripts with
 Javascript src wp but always include scripts with href.
 > I find class.wp-scripts.php always add base url to my src.

 This has to be the expected behaviour, since all assets need to be
 referenced by absolute URL's, can you explain it with a example perhaps?

 > 1 - just do not replace the data from themes
 It simply builds a `<script>` tag based on the data a theme provides, once
 again, and example of what you get, and what you expect would greatly help

 > 2 - allow possibility for developer to choose to add automaticly
 base_url for javascript.
 The base_url for Javascript is always going to be the sites home_url,
 there's no really any way around that..

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38255#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list