Search code examples
javascriptjqueryviewjavascriptmvc

Is it possible (if so, how) to use jQuery's appendTo with $.Views?


Here are two ways I have tried and failed:

//fails
$( $.Views('//home/home.ejs', {data:data}) ).appendTo('#home');

//fails
$( '//home/home.ejs', {data:data} ).appendTo('#home');

Solution

  • I found the error. It should have been $.View and not $.Views. But the second way still won't work.

    //works
    $( $.View('//home/home.ejs', {data:data}) ).appendTo('#home');
    
    //fails
    $( '//home/home.ejs', {data:data} ).appendTo('#home');