What is the definition of entire page
in the following line?
When the entire page is included via PHP include() or require() function, make sure to put that script code inside the
<body>
tag and not inside the<head>
, because calling jQuery script file from inside the tag doesn't work for some reason.
I have had problems in setting up a jQuery codes.
However, I managed to get one to work by putting it inside HEAD
and the following code
#1 code
$(document).ready(function(){
--- code here----
});
I have not managed to get any functions to work. I have had them inside and outside the code #1. The following is an example.
#2 Not working code
function notEmpty() {
//put this in a function and call it when the user tries to submit
var tags = document.getElementById('tags').value;
if(tags == '' || tags == null) {
alert('Please enter one or more tags');
return false;
}
return true;
}
I use PHP to include the tags HTML, HEAD, /HEAD and BODY by the following code in my index.php.
#3 Code by which sources HTML, HEAD and body tags
include ( './official_content/html_head_body.php' );