How to Embed Videos Into a Pop-Up With JavaScript

By Allen Bethea

JavaScript enables Web developers to generate content dynamically within the current browser window or in a new browser window. When a new browser window displays over the current one, it is called a "pop-up." Pop-ups can display any Web content, including videos. The "" function configured without a file name and with the parameter "newwin" creates creates the pop-up. The standard HTML (hypertext markup language) tag "" then loads the video into the pop-up for viewing.

Step 1

Launch the plain-text editor application that is available on your computer.

Step 2

Enter the following code into the text editor.

Step 3

Click the File menu. Select the "Save" option. Save under the file name "test.html" in the same directory as your video file.

Step 4

Launch the Web browser that is available on your computer. Click on the "File" menu item and select "Open File."

Step 5

Locate the file "test.html" just created and select it with the mouse. Click "Open."

Step 6

Click on the button that says, "Click Here to See Pop-Up."

Tips & Warnings

References & Resources