Topics

Function ipAddJs()

ipAddJs — Add JavaScript file to a web page

Description:

ipAddJs ( string $file , [ array|null $attributes ] , [ integer $priority ] )

Add JavaScript file to a web page After adding all JavaScript files, issue ipJs() function to generate JavaScript links HTML code.

Package: ImpressPages

Parameters:

string $file JavaScript file pathname. Can be provided as URL address, a pathname relative to current directory or to website root. Place CSS files in assets subdirectory of a theme or a plugin.
array|null $attributes = null for example array('id' => 'example')
integer $priority = 50 JavaScript file priority. The lower the number the higher the priority.

ipAddJs() function adds JavaScript file to your web page. First, add links to your JavaScript files using ipAddJs() function, then output the ipJs() function result.

<?php
    ipAddJs(ipThemeUrl('theme.js'));
    echo ipJs();
?>

See also

comments powered by Disqus