I’m writing php and I have a custom made control that is Grid and I would wanna know how to attach its javascript with it and everytime someone uses that control the javascript will be included automatically and if it’s already included then it should not be included again.
For example I have the following page:
<html>
<head>
//Notice that nothing is included here
</head>
<body>
<?php grid = new Grid() ?>
</body>
</html>
I believe you want to attach a specific js file (in this case the grid.js) to your html file which in turn will be used by the php grid class.
If loadgridjs has been set then it will include the grid.js to your html. There are other ways how to do this and I believe this is the simplest one