{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/9153","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9153/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9153/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9153/events","html_url":"https://github.com/joomla/joomla-cms/issues/9153","id":134691588,"number":9153,"title":"No attrib for $doc->addScript()","user":{"login":"spignataro","id":72186,"avatar_url":"https://avatars.githubusercontent.com/u/72186?v=3","gravatar_id":"","url":"https://api.github.com/users/spignataro","html_url":"https://github.com/spignataro","followers_url":"https://api.github.com/users/spignataro/followers","following_url":"https://api.github.com/users/spignataro/following{/other_user}","gists_url":"https://api.github.com/users/spignataro/gists{/gist_id}","starred_url":"https://api.github.com/users/spignataro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spignataro/subscriptions","organizations_url":"https://api.github.com/users/spignataro/orgs","repos_url":"https://api.github.com/users/spignataro/repos","events_url":"https://api.github.com/users/spignataro/events{/privacy}","received_events_url":"https://api.github.com/users/spignataro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-18T20:45:36Z","updated_at":"2016-02-18T21:59:18Z","closed_at":null,"body":"public function addScript($url, $type = \"text/javascript\", $defer = false, $async = false)\r\n\r\nThe above is the function call for JDocument. We encounter problems all the time with Cloudflare not liking some Javascript and we use the following to push our javascript:\r\n\r\n$doc = JFactory::getDocument();\r\n$doc->addScript( 'path/to/javascript.js' );\r\n\r\nIt would be nice to have the ability to add attributes so that we can do something like the following:\r\n\r\n$doc->addScript( 'path/to/javascript.js', array( 'data-cfasync=\"false\"');\r\n\r\nSo that could print out the following:\r\n\r\n<script data-cfasync=\"false\" src=\"path/to/javascript.js\"></script>  \r\n\r\nThis would allow Cloudflare to bypass using it's rocket loader on the javascript file that we know it is having a rough time with. \r\n\r\nThis would also help with many other things besides cloudflare - but this is just an example."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/185941009","html_url":"https://github.com/joomla/joomla-cms/issues/9153#issuecomment-185941009","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9153","id":185941009,"user":{"login":"dgt41","id":3889375,"avatar_url":"https://avatars.githubusercontent.com/u/3889375?v=3","gravatar_id":"","url":"https://api.github.com/users/dgt41","html_url":"https://github.com/dgt41","followers_url":"https://api.github.com/users/dgt41/followers","following_url":"https://api.github.com/users/dgt41/following{/other_user}","gists_url":"https://api.github.com/users/dgt41/gists{/gist_id}","starred_url":"https://api.github.com/users/dgt41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgt41/subscriptions","organizations_url":"https://api.github.com/users/dgt41/orgs","repos_url":"https://api.github.com/users/dgt41/repos","events_url":"https://api.github.com/users/dgt41/events{/privacy}","received_events_url":"https://api.github.com/users/dgt41/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T21:59:18Z","updated_at":"2016-02-18T21:59:18Z","body":"@spignataro rearranging the flags CANNOT happen in 3.x for B/C reasons\r\nAlso `addScript()` is NOT overridable so you are making things hard for others, not a good thing! "}}