Insert ajax into php

yes the username is inside a cookie and I call it from within the calling file. I will try your suggestion thanks

This is how to file containing the ajax script looks like when I view the source.

This is get_chart.php - the file that uses the ajax test. I have now included the js. The result is the same as when I use get_file_content

and you dont see anything in the console still?

Have you accidentally set your console to filter out messages?

Hi @henk3, as an aside it’s also possible to access cookies with JS directly so that you don’t have to generate JS with PHP; such static JS can then get loaded as usual like

<script src="my-script.js"></script>

Maybe that’s easier (and certainly cleaner) than jumping through hoops to include your JS as PHP files…

2 Likes

I included HTML tags with the jquery library in the file that calls the JS function. It works now. (somewhat - trying to fix another issue)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.