Try this,
$(".pageContainer").html(check(test)['content']);
If you need javascript function inside an html() then your js check()
should return an array
like,
function check(test){
var arr=[];
// your code
arr['content']='some value';
return arr;
}
Live Demo
If check()
is a php function
then you need to use ajax() like,
$(function(){
var test='your value';
$.ajax({
url:'function.php',
dataType:'json',
data:{action:'check',test:test},
type:'POST',
success:function(data){
$(".pageContainer").html(data.content);
}
});
});
Function.php page
<?php
$action=isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if($_REQUEST['action'] == 'check'){
echo json_encode(array('content'=>$_REQUEST['test']));
return;
}
?>