0
google plus 코드를이 방법으로 사용하는 것이 IE8이나 다른 버전에서 작동하지 않는 이유는 무엇입니까? 그래도 파이어 폭스에서 잘 작동합니다.IE8의 자바 스크립트 괴짜, document.write 문제
라이브 데모 : http://jsfiddle.net/9zqsZ/
<script>
var socialString = '<g:plusone size="tall"></g:plusone>';
document.write(socialString);
//google plus share button
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
난 그냥 외부 파일에 넣어 노력하고 있어요. 이상한 것은 document.write에서 작동하지 않고 html에 직접 배치되는 경우에만 작동한다는 것입니다. 이 경우 어떻게 구현합니까?
내 콘솔 코드 – devjs11
그게 이상한 "문자열에 잘못된 문자가 포함을"퍼팅 오류를 반환, 그것은 IE8에서 나를 위해 일한 될 수있는 몇 가지 추가 문자가 추가되었다 동안 당신은 코드를 복사 한 후 pls가 한 번 –
ok가 잘 작동하는지 확인합니다. 편집 된 대답을 확인하십시오. –