Ciao a tutti,
ho un problema con questa semplicissima pagina html dove non riesco a far andare un alert all'interno del $(document).ready.
Il file jquery è presente e l'alert funziona solo se è fuori dal $(document).readycodice:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script language="text/javascript" src="js/jquery-1.8.2.min.js"></script> <script language="text/javascript"> /* Before page loads */ $(document).ready(function() { alert('ok'); // do stuff when DOM is ready $('#menu-biography').offset({ top:200, left:400}); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Nico Trez ~ Official</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div id="menu-biography">[img]img/biography-bn.png[/img]</div> </body> </html>
Grazie per l'aiuto!


Rispondi quotando