[ 
https://issues.apache.org/jira/browse/SHINDIG-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291288#comment-13291288
 ] 

Stanton Sievers commented on SHINDIG-1794:
------------------------------------------

I think the loop should be the following.  We want to ensure that scriptEls is 
truthy before we check the length.  Also added the break in the 'if'.

      var scriptEls = document.getElementsByTagName('script');
      for(var i = 0; scriptEls && i < scriptEls.length; i++) {
        
if(/.*gadgets\/js\/.*container.*[.]js.*[?&]c=1(&|$).*/.test(scriptEls[i].src)) {
          scriptEl = scriptEls[i];
          break;
        }
      }
                
> In init.js the loop that looks for script tags is broken
> --------------------------------------------------------
>
>                 Key: SHINDIG-1794
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1794
>             Project: Shindig
>          Issue Type: Bug
>          Components: Javascript 
>    Affects Versions: 2.5.0-beta2
>            Reporter: Doug Davies
>             Fix For: 2.0.3
>
>
> In beta2 the logic was changed for how it looks for the script tags to figure 
> out the container, etc.  The for loop is broken.
> If I change
>       for(var i = 0; !scriptEls && i < scriptEls.length; i++) {
> to
>       for(var i = 0; i < scriptEls.length; i++) {
> It fixes the issue and the right container is used.
> I would like to see this fixed for beta2 if possible.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to