assume that there is a a.php
facet
with the introduction of abc.js
and a abc.min.js
( abc.js
core), which is the package needed for this facet. There is no problem with this.
<script src="abc.min.js"></script>
<script src="abc.js"></script>
</body>
but
when I use require_once
to introduce a b.php
file in a.php
,
b.php
is also useful for this suite. When I use ajax GET to retrieve the data of b.php
and return to a.php, which suite becomes unusable?
<div id="tab"></div>
$(".btn").click(function(e) {
e.preventDefault();
var id = e.currentTarget.dataset.id;
$("-sharptab").html("...");
$.ajax({
type: "GET",
url: "b.php?id="+id,
success: function(data){
$("-sharptab").html(data);
}
});
});
but obviously it can be used in a.php
.
so I wonder: I need to introduce abc.js
again in a.php
print b.php
?
so I put < script src= "abc.js" > < / script >
after b.php
, it works!
but what matters is that my two JS abc.min.js
and abc.js
introduce
under < div id= "tab" > < / div >
like this:
<div id="tab"></div>
<script src="abc.min.js"></script>
<script src="abc.js"></script>
so when I introduced b.php
into tab
(because I also added < script src= "abc.js" > < / script >
to b.php
)
problem is that this JS must be executed abc.min.js
before it can be used, but it can be used when abc.min.js
has not been fetched?
but there is a reporting error: XXX not defind
Why did this happen?
how can I improve this?