Opus Pro Features:
Entries in the <HEAD> section of Publish Settings will only be included when publishing as a single page or as multiple pages. For content published to Single DIV you will need to add the function to the <HEAD> section of the HTML your are including your Opus content in.
You can do the same thing with OpusScript by using the syntax 'variable=window.function()' so the script would be:
We can use the same process to get information we might often want to use on a web page such as the date or the screen width of the device being used - useful for displaying a different page of your content for mobile users.
Objects can be referred to by the label
and if there is additional content to that object it can be accessed using
_DWPub.PageName.ObjectName.element() for graphical objects,
_DWPub.PageName.ObjectName.videoElement() for video
_DWPub.PageName.ObjectName.audioElement() for audio.
Note: Users with versions prior to Opus Pro v9.6 should drop the _DWPub and use the syntax PageName.ObjectName.m_audioElement and ...m_videoElement without brackets in both cases.
This allows you to create actions in Opus to access properties of HTML5 components such as the current position of video or tell a sound file to play using the HTML properties (details available W3Schools) though not all may be appropriate to Opus publication elements.