I have a set of js files in the layout.phtml, but i dont need to load all the js files at once instead, i need to load on the individual pages. How can i do that.
<?php echo $this->headScript()
->appendFile($this->basePath() . '/js/jquery.js')
->appendFile($this->basePath() . '/js/jquery-1.9.1.min.js')
->appendFile($this->basePath() . '/js/jquery-ui.js')
->appendFile($this->basePath() . '/js/bootstrap.min.js')
->appendFile($this->basePath() . '/plugins/underscore/underscore-min.js')
->appendFile($this->basePath() . '/plugins/moment/moment.js')
->appendFile($this->basePath() . '/plugins/pace/pace.min.js')
->appendFile($this->basePath() . '/plugins/wysiwyg/bootstrap3-wysihtml5.all.min.js')
->appendFile($this->basePath() . '/plugins/validator/bootstrapValidator.min.js')
->appendFile($this->basePath() . '/plugins/clock-picker/clockpicker.js')
->appendFile($this->basePath() . '/plugins/bootstrap-calendar/js/calendar.js')
->appendFile($this->basePath() . '/plugins/Chart.js-master/Chart.js')
->appendFile($this->basePath() . '/js/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9',))
->appendFile($this->basePath() . '/js/html5shiv.js', 'text/javascript', array('conditional' => 'lt IE 9',))
->appendFile($this->basePath() . '/js/main.js')
->appendFile($this->basePath() . '/js/profile.js')
->appendFile($this->basePath() . '/js/profile_12.js')
->appendFile($this->basePath() . '/js/profile_2.js')
->appendFile($this->basePath() . '/js/profile_users_medical_events.js')
->appendFile($this->basePath() . '/plugins/cropper/cropper.min.js')
->appendFile($this->basePath() . '/js/profile-photo.js')
->appendFile($this->basePath() . '/js/select2.min.js')
->appendFile($this->basePath() . '/js/selectize.min.js')
->appendFile($this->basePath() . '/js/new_appointment.js')
->appendFile($this->basePath() . '/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js')
->appendFile($this->basePath() . '/js/users_profile_chart.js')
->appendFile($this->basePath() . '/js/livestamp.min.js')
->appendFile($this->basePath() . '/js/res.js')
->appendFile($this->basePath() . '/js/rec.js')
->appendFile($this->basePath() . '/js/settings.js')
; ?>
What i need is load only the needed js file .