javascript - Two same instances created with page refresh in moodle -
i calling ajax function moodle block when onchange event detected. sends courseid server page , returns necessary fields updates div inside block. dropdown has onchange event generated database call. problem is, when adding block in moodle page, page refreshed , see 2 instances of block. reason?
update
the structure of code following;
<script></script> <?php ?>
from inside php block calling javascript function parameters. changing div of php block. javascript sending parameters php page wrote db queries. when changed code following, error gone:
<?php script written inside $this->content->text ?>
can shed light on reason?
Comments
Post a Comment