I do have a php page in my WP site, and I am trying to add a Jquery script directly in the php. basically something like this , the structure...**
<?php
/*
Template Name: Gallery Page
*/
?>
<?php get_header(); ?>
<?php
//here i have my working php code
?>
//here some HTML
<script language="JavaScript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
alert("hi");
</script>
<?php
endwhile;
else :
// no rows found
endif;
?>
<div class="spacing"></div>
<?php get_footer(); ?>
Anyone knows why my javascript code dont work if i set like I set in the script,. while it works if I only type
<script>
alert("Hi");
</script>
Also: if I link jquery in the footer, and call a external script in my site with this code above, it works. The alert starts. Anyone knows why? it seems correct what i did and i am struggling to get over this.
thanks in advance