This is simply a question that I cant seem to find answered. I have test.php included at the top of the main.php page. test.php contains jquery code with php inside of it and it is all wrapped in script tags. Am i able to include that file and use the jquery on that included file? Currently is not working but I may be doing something wrong. The question is am I able to do the include or do I have to have the script tags on the main.php page. Thanks Hope this makes sense.
<?php $query = mysql_query("SELECT * FROM table WHERE id = 1");
$row = mysql_fetch_assoc($query);
$result = $row['result'];
?>
<script type="text/javascript">
var result = '<?php echo $result ?>';
$(document).ready(function(e) {
$("#div td:contains(" + result + ")").addClass('greenborder');
});
</script>