0

Hi guys,
I'running on wordpress
I made this:
https://i.stack.imgur.com/gQxkx.png

When I click on ''Click here to play the video clip'' it open a new (blank) window)
in HTML editor I wrote code:

<a href="#" onClick="window.open('','video','top=50, left=50, width=280, height=257, toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no,');">Click here to play the video clip</a> 


But, I don't know how to implent this code into this blank space:

<script src='http://hqq.tv/player/hash.php?hash=244206211243244205241239213235211241'></script><script src='http://hqq.tv/player/script.php?width=720&height=450'>

I want this blank window will be looks like this:

https://i.stack.imgur.com/NxvvM.png

Have you any solutions?

Thanks for help.. Have a nice day ! :)

adk
  • 3
  • 1
  • 2

1 Answers1

0

In the window.open('', part you missed the first important part: the URL you should render. What you can do is, within your same web project, you can either:

a) Create a new, dynamic URL where you can pass the Video ID or something that let's you reference a single video and open that dynamic URL.

or, if you don't have a backend language, then you can...

b) Modify the content of the about:blank page you just opened by creating the popup, adding the HTML code inside and opening it. You'll still have an about:blank URL but you'll be actually seeing whatever content you put there. To do so, you should...

// Source: http://www.electrictoolbox.com/write-content-dynamic-javascript-popup/

var w = window.open('', '', 'width=400,height=400');
w.document.write('HTML content goes here, such as your script from hqq.tv');
w.document.close();

And modify the script accordingly.

PS: Be aware that, in order to write a script tag with Javascript, you'll have to split the tag in order to render it. Check this answer to see the problem and solution.

Community
  • 1
  • 1
Patrick D'appollonio
  • 2,722
  • 1
  • 18
  • 34
  • Thank for help :) works fine! ... i implented this code (in next response)
    this works! :) you can see it on http://maturita.info/logo/ ..it is different code from different webplayer with `
    – adk Dec 02 '15 at 16:09
  • `` – adk Dec 02 '15 at 16:09
  • That's great! I did answer your second problem as well, in the "PS" part. Essentially is, since you're writing Javascript inside Javascript, the final ` – Patrick D'appollonio Dec 02 '15 at 21:01
  • I have have solution, I wrote this: ` – adk Dec 08 '15 at 16:14
  • Just wire the creation process to a function. [Take a look at this example using jQuery](https://jsbin.com/widutuneyi/edit?html,output). – Patrick D'appollonio Dec 08 '15 at 22:20