c.apply is not a function
<p>This code give me this error: <code>c.apply is not a function</code>
All code works well only if i use one function. However i am not sure about how use two functions. These lines are probably wrong :</p>

<pre><code> postHandler(&lt;?php echo get_posts($db, 0, $_SESSION['posts_start']); ?&gt;, &lt;?php echo get_posts1($db, 0, $_SESSION['posts_start']); ?&gt;);
</code></pre>

<p>and</p>

<pre><code>var postHandler = function(postsJSON, postsJSON1) {
$.each(postsJSON, postsJSON1, function(i, post, post1) {
</code></pre>

<p><em>script</em></p>

<p><strong>first function</strong></p>

<pre><code>function get_posts($db, $start, $number_of_posts) {
       //code
            return json_encode($posts);
        }
</code></pre>

<p>output:</p>

<pre><code>string '[{"username":"Altitude software","foto_oferta":"thumb\/miniaturas\/oferta\/default_offer.jpg","actividades":"Some activities","id_oferta":77,"oferta":"Programador web" ...
</code></pre>

<p><strong>second function</strong></p>

<pre><code>function get_posts1($db, $start, $number_of_posts) {
       //code
            return json_encode($posts1);
        }
</code></pre>

<p>output:</p>

<pre><code>string '[{"id_offer":77,"tags":["c++","JAVA"]},{"id_offer":76,"tags":["ajax","php"]},{"id_offer":75,"tags":["PHP","JAVA"]}]'
</code></pre>

<p><strong>js</strong></p>

<pre><code>var postHandler = function(postsJSON, postsJSON1) {
                $.each(postsJSON, postsJSON1, function(i, post, post1) {
                    var id = 'post-' + post.id_oferta;

                    $('&lt;div&gt;&lt;/div&gt;').addClass('post').attr('id',id)
                    .html('&lt;div class="box_offers"&gt;&lt;div class="rating_offer"&gt;&lt;/div&gt;&lt;div class="post-title"&gt;' 
                            + post.oferta + '&lt;/div&gt;  &lt;div class="post-box"&gt; &lt;a class="oferta_val bold_username"&gt;'
                            + post1.tags + '&lt;/a&gt;&lt;/div&gt;&lt;a id='+id+'hide class="post-more" &gt;Descrição&lt;/a&gt;&lt;div class="logo_offer"&gt;')
                            .appendTo($('#posts'));

                    $('#'+id+'hide').click(function() {
                        $('.'+id+'hidden').slideToggle('fast');
                    });
                }); 
            };

postHandler(&lt;?php echo get_posts($db, 0, $_SESSION['posts_start']); ?&gt;, &lt;?php echo get_posts1($db, 0, $_SESSION['posts_start']); ?&gt;);
</code></pre>
