<div id="notice"></div>
<script type="text/javascript">
function shownum(width) {
document.getElementById('notice').innerHTML = '<p>' + width + '</p>';
}
</script>
<?php
function showjsmessage($width)
{
echo '<script type="text/javascript">shownum(\'' . $width . '\');</script>';
// echo $width;//这样是不行的
ob_flush();
flush();
}
$totalnum = 100;
for ($i = 1; $i <= $totalnum; $i++) {
$width = $i/$totalnum * 100;
showjsmessage($width);
usleep(10000);
}
?>
<script type="text/javascript">
function shownum(width) {
document.getElementById('notice').innerHTML = '<p>' + width + '</p>';
}
</script>
<?php
function showjsmessage($width)
{
echo '<script type="text/javascript">shownum(\'' . $width . '\');</script>';
// echo $width;//这样是不行的
ob_flush();
flush();
}
$totalnum = 100;
for ($i = 1; $i <= $totalnum; $i++) {
$width = $i/$totalnum * 100;
showjsmessage($width);
usleep(10000);
}
?>