The code is confusing at your end, your code looks like a full HTML page instead of a WebCenter Page.
What do you need exactly?
A way of sharing the Current Page in an Oracle WebCenter Page?
A way of sharing the Page in a HTML Markup?
Depending on the answers may I can provide the required support.
Note: Yes, JS Works in WCP 12c too