Here's a basic test. Create the two following files and bower install
polymer 0.1.4.
index.html:
<html>
<head>
<title>HTML Imports Test</title>
<script src="bower_components/platform/platform.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="my-import.html">
</head>
<body>
HTML Import Test<br/><br/>
These values are captured in the imported script and then displayed
here in the parent doc.<br/><br/>
<code>
<div><strong>document.currentScript = </strong><span id=
"noPrefix"></span></div>
<div><strong>document._currentScript = </strong><span id=
"prefixed"></span></div>
<div><strong>HTMLImports.currentScript = </strong><span id=
"htmlImports"></span></div>
</code>
</body>
</html>
my-import.html
<script type="text/javascript">
var parentDoc = document;
// Display current script values on parent page
parentDoc.getElementById("noPrefix").innerHTML = "" + document.
currentScript;
parentDoc.getElementById("prefixed").innerHTML = "" + document.
_currentScript
parentDoc.getElementById("htmlImports").innerHTML = "" + HTMLImports.
currentScript
</script>
On Tuesday, January 28, 2014 12:20:24 PM UTC-6, Steve Orvell wrote:
>
> The HTMLImports polyfill should ensure that "document._currentScript" is
> universally available (of course document.currentScript is correct but it's
> not possible to correctly polyfill so we opt for _currentScript).
>
> I can't seem to reproduce this issue. A test case would be extremely
> helpful, thanks.
>
>
> On Tue, Jan 28, 2014 at 8:09 AM, <[email protected] <javascript:>> wrote:
>
>> The API docs for HTMLImports says
>>
>> In a native HTML Imports, document.currentScript.ownerDocumentreferences the
>> import document itself. In the polyfill use
>>> document._currentScript.ownerDocument (note the underscore).
>>
>>
>> Given the changes to HTMLImports in this release, is this still suppose
>> to work in 0.1.4?
>>
>> After upgrading to 0.1.4, inside a script tag in my import file
>> document.currentScript is null while document._currentScript is undefined.
>>
>>
>> Changing my code to get the doc from HTMLImports.currentScript fixed
>> everything for me.
>>
>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/polymer-dev/b54b3d93-54b8-48d7-8a6c-8239656aaf92%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/ac4278a3-a98b-48e8-ad72-ca9d50460249%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.