php - Load jQuery into <body> -


my structure following:

<html>   <head>   </head>   <body>     <?php include('form.php')?>     <script src='jquery.js'>   </body> </html> 

my php include not executes jquery functions...

i put jquery functions in form.php a:

$(document).ready(function() {     $('.newbooking').click(function() {         alert($(this).attr("data-date"));        }); }); 

but nothing...

is normal ?

try with:

<script src='jquery.js'> <?php include('form.php')?> 

your code doesn't work because try use jquery before loaded. use $(document).ready call jquery function. use it...


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -