Verse 17: And there was not a man left in Ai or Beth-el, that went not out after Israel: and they left the city open, and pursued after Israel.
[Not even one] But a multitude unfit for war remained within the gates, verse 24 (Masius, Bonfrerius).
Not a man, to wit, fit for war.
[In the city, בָּעִיר] Some codices read בָּעַי, in Ai (Masius). Thus Jonathan. Thus in the place of לָעִיר, of the city, verse 12, the eastern codices have לָעַי, of Ai, as in verse 9 (Grotius on verse 12).
[Ai and Beth-el] As for the fact that the men of Bethel are joined with them, it is to be mentioned that they were called forth before the blockade (Bonfrerius). They appear, with their own town abandoned, to have been in Ai for a little while, so that they might defend the more fortified city with combined strength, since otherwise they would have been under the dominion of this King; for it is said, in the city, not, in the cities (Masius). Objection: But Beth-el was an exceedingly well-fortified bown, Judges 1:24. Response: Therefore, the Canaanites in the following times built up the walls of that city (Masius).
Beth-el, being a neighbouring city, and encouraged by the former success, had sent some forces to assist them; and now, upon notice sent to them of the flight of their common enemies, or upon some other signal given, which might easily be done, having been appointed beforehand, as is usual in such cases, all their men of war join with those of Ai in the pursuit.
 Hebrew: וְלֹֽא־נִשְׁאַ֣ר אִ֗ישׁ בָּעַי֙ וּבֵ֣ית אֵ֔ל אֲשֶׁ֥ר לֹֽא־יָצְא֖וּ אַחֲרֵ֣י יִשְׂרָאֵ֑ל וַיַּעַזְב֤וּ אֶת־הָעִיר֙ פְּתוּחָ֔ה וַֽיִּרְדְּפ֖וּ אַחֲרֵ֥י יִשְׂרָאֵֽל׃
 Joshua 8:12: “And he took about five thousand men, and set them to lie in ambush between Bethel and Ai, on the west side of the city (לָעִיר).”
 Joshua 8:9a: “Joshua therefore sent them forth: and they went to lie in ambush, and abode between Bethel and Ai, on the west side of Ai (לָעָי)…”