TextSide makes it easy to include your own Javascript and Resource files (such as Style Sheets) into your CodeBehind pages and Parts.
To add any Javascript file to your CodeBehind Page or Part, use the following code in your View Handler:
<?php
//$this->addJavascriptHeader($path);
$this->addJavascriptHeader($this->binDirectory."js/myfile.js");
?>
Ussually your Javascript file will be contained in a 'bin' folder. For example:
For CodeBehind Pages:
================================
mypage.php
|--bin/
|--js/
|--myfile.js
For Parts:
================================
partName.php
|--bin/
|--js/
|--myfile.js
You can also include CSS files to your page using:
<?php
$this->addJavascriptHeader($this->binDirectory."css/myfile.css");
?>
You can also include any arbitrary HTML that you wish in your pages HTML header by using $this->addHeader:
<?php
$this->addHeader("<script src=\"$path\" type='text/javascript></script>");
?>
For more examples, please see the
CodeBehind and
Parts AJAX examples.