php, js - echoing a number based on how many children there are?
Creating a site in with FrogCMS and using alot of jquery to create an all in one screen site.
having trouble in php echoing a number for the number of children for a subject in the database which i can then use as a var in js.
some things ive tried, but im not really a developer so having issues
here is some code frog supplies to show to utilise articles for example, and articles then has childen in the database.
<?php $page_article = $this->find('/articl开发者_开发技巧es/'); ?>
<?php $last_article = $page_article->children(array('limit' => 1, 'order' => 'page.created_on DESC')); ?>
but im not sure how to create a discrete number to use with the jquery concerning the number of children??
thanks
May this could work :
<script type="text/javascript">
var nbChildren = <?php $comments = $page_article->children(); echo sizeof($comments); ?>
</script>
精彩评论