Skip to content

Commit

Permalink
Merge pull request #39 from etu/master
Browse files Browse the repository at this point in the history
Please don't suggest people to use document.write anymore...
  • Loading branch information
joar committed Dec 3, 2012
2 parents 71e40b7 + 81014a6 commit d5528c8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
9 changes: 5 additions & 4 deletions examples/talkatv-test/index.html
Expand Up @@ -23,10 +23,11 @@ <h2>Comments</h2>
var talkatv_ordered = true;

/* Include talkatv.js */
document.write(unescape('%3Cscript src="'
+ talkatv_home + (window.talkatv_shortcut
? '/talkatv.js' : '/static/js/talkatv.js')
+ '" type="text/javascript"%3E%3C/script%3E'));
script = document.createElement('script');
script.src = talkatv_home + (talkatv_shortcut ? '/talkatv.js' : '/static/js/talkatv.js');
script.type = 'text/javascript';

document.body.appendChild(script);
</script>
<noscript>
<p>Currently you will need JavaScript to read and post
Expand Down
18 changes: 10 additions & 8 deletions talkatv/templates/talkatv/index.html
Expand Up @@ -62,10 +62,11 @@ <h2 id="embed-it">Embed it</h2>
// use /talkatv.js instead of /static/js...
var talkatv_shortcut = true;

document.write(unescape('%3Cscript src="'
+ talkatv_home + (window.talkatv_shortcut
? '/talkatv.js' : '/static/js/talkatv.js')
+ '" type="text/javascript"%3E%3C/script%3E'));
script = document.createElement('script');
script.src = talkatv_home + (talkatv_shortcut ? '/talkatv.js' : '/static/js/talkatv.js');
script.type = 'text/javascript';

document.body.appendChild(script);
&lt;/script&gt;</pre>
<p>If you want to account for non-js-enabled browsers too you may add this <code>&lt;noscript&gt;</code> tag right after the <code>&lt;script&gt;</code> tag.</p>
<pre class="pre-scrollable">&lt;noscript&gt;
Expand Down Expand Up @@ -96,10 +97,11 @@ <h2>Try it out!</h2>
var talkatv_ordered = true;
var talkatv_shortcut = true;

document.write(unescape('%3Cscript src="'
+ talkatv_home + (window.talkatv_shortcut
? '/talkatv.js' : '/static/js/talkatv.js')
+ '" type="text/javascript"%3E%3C/script%3E'));
script = document.createElement('script');
script.src = talkatv_home + (talkatv_shortcut ? '/talkatv.js' : '/static/js/talkatv.js');
script.type = 'text/javascript';

document.body.appendChild(script);
</script>
<noscript>
<p>
Expand Down

0 comments on commit d5528c8

Please sign in to comment.