JS not working

Alles, was den Apache betrifft, kann hier besprochen werden.

JS not working

Postby houssamballout » 20. May 2020 09:54

Hello,

I had installed Apache and PHP and all is working good.

I had made a test php age which calls a JS file and the script had been loaded correctly, however, when I tried with another longer JS file, the file is not loaded.

What do you think is the issue?

Thank you
houssamballout
 
Posts: 4
Joined: 20. May 2020 09:52
XAMPP version: Apache
Operating System: Windows 10

Re: JS not working

Postby Nobbie » 20. May 2020 21:39

Weird problem. PHP cannot call JS, PHP is running on the webserver executed by Apache. JS is running later on at the client, executed by the browser. Two totally different environments.
Nobbie
 
Posts: 11565
Joined: 09. March 2008 13:04

Re: JS not working

Postby houssamballout » 21. May 2020 07:22

Yes,I was working with datatables and when I tried on different computer where I had installed WAMP / XAMP it worked normally.

What do you think this could be?
houssamballout
 
Posts: 4
Joined: 20. May 2020 09:52
XAMPP version: Apache
Operating System: Windows 10

Re: JS not working

Postby Nobbie » 21. May 2020 09:39

I have no idea, i even did not understand the problem. I only can say, that PHP and JS do not work together. I dont know what you are doing, maybe you should show an example.
Nobbie
 
Posts: 11565
Joined: 09. March 2008 13:04

Re: JS not working

Postby houssamballout » 21. May 2020 10:33

I am having a php page which is fetching records from POSTGRESS table, and then I am using the datatable (https://datatables.net) to customize table functionality.
houssamballout
 
Posts: 4
Joined: 20. May 2020 09:52
XAMPP version: Apache
Operating System: Windows 10

Re: JS not working

Postby Nobbie » 21. May 2020 13:39

Still no code, we cannot help without any code.

But i still assume, that you have a big problem about understanding how and when PHP is executed and the scope of the data, in comparison to the scope of JS. You cannot fetch data with PHP and assign to to JS functions, that is not the way it works.
Nobbie
 
Posts: 11565
Joined: 09. March 2008 13:04

Re: JS not working

Postby houssamballout » 22. May 2020 07:44

I am working with datatables

I know how PHP is executed at the server and JS at the browser side
houssamballout
 
Posts: 4
Joined: 20. May 2020 09:52
XAMPP version: Apache
Operating System: Windows 10

Re: JS not working

Postby Nobbie » 22. May 2020 10:18

As long as you dont show any code, nobody can help you. Its on you if you want help or not.

Last not least, if you have a problem with datatables.net, they have their own support. We do not support 3d party products.
Nobbie
 
Posts: 11565
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 3 guests