glFusion Wiki

Site Tools


glfusion:development:api:output_class:addscript

outputHandler::addScript

(glFusion SVN)

addScript – Adds raw JavaScript to page header

Description

void addScript($code, $priority, $mime)

Adds raw JavaScript to the page header. The JavaScript should not be wrapped in <script> tags.

Parameters

code

The JavaScript code to be sent to the browser.
This function will automatically wrap the JS code with the 
necessary <script> </script> tags.

priority

The load priority of the JS data.  Options are:

  * HEADER_PRIO_VERYHIGH
  * HEADER_PRIO_HIGH
  * HEADER_PRIO_NORMAL
  * HEADER_PRIO_LOW
  * HEADER_PRIO_VERYLOW

Items with HEADER_PRIO_VERYHIGH are sent to the browser before 
those with HEADER_PRIO_HIGH…

The default value is HEADER_PRIO_NORMAL.

mime

Mime type to use for the code.  The default value is ‘text/javascript’

Return Value

No value is returned.

Example

Notes

See Also

glfusion/development/api/output_class/addscript.txt · Last modified: 2017/04/12 21:15 (external edit)

Page Tools