Я пытаюсь отобразить описание автора и темы в соответствии с выбранным меню, выбрав значение темы, используя ajax
Я попытался передать $ output as и перехватить его из ajax, но не могу этого сделать
get ('Автор ');$ description = $ mytheme-> get ('Description');?>
<div id="dom-target" style="display: none;">
<?php
$output = $description; //Again, do some operation, get the output.
echo htmlspecialchars($output); /* You have to escape because the result
will not be valid HTML otherwise. */
?>
</div>
<div id="dom-target1" style="display: none;">
<?php
$output1 = $author; //Again, do some operation, get the output.
echo htmlspecialchars($output1);
?>
</div>
<?php
if ($output1) {
?>
<script type="text/javascript">
window.onload=function() { // when the page has loaded
document.getElementById("themelist").onchange=function() {
document.getElementById("cauthor").value() = '<?php echo $output1; ?>';
}
}
</script>
<?php
}
wp_die(); }
}