0
방금 Polymer를 사용하기 시작 했으므로이 요소에 맞춤형 SoundCloud 플레이어를 만들고 싶습니다. 내가 iframe이 올바른 방법을 목표로하고 있지 않다 의미한다폴리머 내의 자바 스크립트
Uncaught Error: SC.Widget function should be given either iframe element or a string specifying id attribute of iframe element.
,하지만 난 (거의 4시간 때문에) 그렇게 할 수있는 또 다른 방법을 생각할 수 없다 : 어떻게 든 나는 다음과 같은 오류가 계속.
= 내 문제는입니다. 왜 var iframe = $(".iframe");
은 iframe을 타겟팅하지 않습니다. 나는 Polymer 외부에서 그것을 시험해 보았고 거기에서 잘 작동했다.
차단기 stream.html는 :
<polymer-element name="breaker-stream" attributes="url">
<template>
<iframe class="iframe" width="100%" height="450" scrolling="no" frameborder="no" src="{{url}}"></iframe>
<script>
var iframe = $(".iframe");
var widget = SC.Widget(iframe);
</script>
</template>
<script>
Polymer('breaker-stream', {
url: ""
});
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://w.soundcloud.com/player/api.js"></script>
</polymer-element>