Cita:
Iniciado por sergiop21
si ocupo php del lado del servidor, si no te molesta me podrias dar un ejemplo o como se trabajaria con div y con overflow??? muchas gracias desde ya
como dije, para ello necesitas AJAX y ahí si seria mucha tela que cortar, si sabes algo de AJAX podrias usar XAJAX que te aligera su implementación con php y te permite hacerlo de forma rápida sin necesidad de escribir javascript
:
xajax hello world:
Código PHP:
<?php
/*** include the xajax bootstrap ***/
include 'xajax/xajax_core/xajax.inc.php';
/*** a new xajax object ***/
$xajax = new xajax();
/*** register a PHP function with xajax ***/
$rqstButton = $xajax->register(XAJAX_FUNCTION, 'showText');
/*** set the request button parameters ***/
$rqstButton->setParameter(0, XAJAX_JS_VALUE, 0);
/*** process the request ***/
$xajax->processRequest();
function showText()
{
/*** the content to assign to the target div ***/
$content = 'Hello World';
/*** a new response object ***/
$objResponse = new xajaxResponse();
/*** assign the innerHTML attribute to the new $content ***/
$objResponse->assign("my_div","innerHTML", $content);
/*** return the object response ***/
return $objResponse;
}
/*** process the request ***/
$xajax->processRequest();
/*** the path is relative to the web root mmmk ***/
$xajax_js = $xajax->getJavascript('/xajax');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>PHPRO.ORG</title>
<?php echo $xajax_js; ?>
</head>
<body>
<button type="button" onclick="<?php $rqstButton->printScript(); ?>">Click me</button>
<div id="my_div">New text will happen here</div>
</body>
</html>