1

Any ideas how can I alter this code in order to work in a blogger post?

<script language="JavaScript">
    function openWin(){
        var myBars='directories=no,location=no,menubar=no,status=no';
        var myOptions='scrollbars=no,top=200,left=390,width=451,height=345,resizeable=no';
        var myFeatures = myBars + ',' + myOptions;
        var newWin = open('', 'myDoc', myFeatures);
        newWin.document.writeln('<form>');
        newWin.document.writeln('<BODY BGCOLOR="#000000">');
        newWin.document.writeln('<embed src ="http://www.antenna.gr/webtv/images/fbplayer.swf?cid=07_f_y_mfa_y$_a_e=&volx=100&iu=1&telemetry=false" width="426" height="320" allowfullscreen="true"/>');
        newWin.document.writeln('</form>');
        newWin.document.close();
        newWin.focus();
    }
</script>

<form>
    <input type=BUTTON title="Δείτε το Επεισόδιο!" value="01" onClick='openWin()'>
</form>
2
  • Are you getting any errors in the console? Commented Dec 23, 2012 at 0:48
  • I took out the lines with the <form> and </form> in the new window document, and it loads just fine in my blogger... (the video isn't permitted in my locale, but it runs just fine otherwise. Commented Dec 23, 2012 at 1:22

1 Answer 1

1

Well first of all you're writing your <form> tag into the new window before the <body> tag, but aside from that... WHY???

Why are you requiring a popup? Why not just have the content in the main window in the first place? Why not load it into the current window?

Anyway, that's not really what should be in an answer. The answer I have for you is that you may not be able to open popup windows in your browser. Some browsers block popups that try to hide the address bar, for instance.

If this doesn't help any, try being more specific on what "it doesn't work" means.

Sign up to request clarification or add additional context in comments.

5 Comments

It works on any browser perfectly but when I try to put it in a blogger post it doesn't open a new window.
Does blogger allow JavaScript?
Yes...I use for example this for youtube links> <button a="a" href="javascript:void(0);" onclick="window.open('youtube.com/watch_popup?v=6t9hpdldbEQ', 'popup', 'top=200, left=390, width=426, height=320, toolbar=NO, resizable=NO, Location=NO, Menubar=NO, Titlebar=No, Status=NO')" title="Δείτε το Επεισόδιο!"> 01 </button>
That's inline JS, though, which isn't necessarily the same as an actual <script> tag in terms of what may or may not be allowed.
I think it is allowed according to this stackoverflow.com/questions/13122245/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.