Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,

Please help me..
I have created dynamic website. I have included Php file to multiple pages which contain javascript and jquery function. Is it a right way?? Will it create any problem in my website.

Please help.

Thanks in advance.

What I have tried:

I have added External PHP file to all pages which contain javascript and jquery Function. and it is working properly.
Posted
Updated 28-Apr-18 2:37am
v2
Comments
Arthur V. Ratz 28-Apr-18 8:29am    
php + javascript + jquery is *NOT* ASP.NET. Unfortunately you normally cannot call javascript function declared in a html web page from inside a php or any other script.

1 solution

The solution of this problem is to re-work a html web-page having inline javascript functions and specific php-script for this page so that the javascript function you're about invoke while executing php-script will be called prior to any of functions in php-script. The returning value computed by this javascript function will easily be passed to one or multiple functions inside php-script by using AJAX requests, and you'll no longer need to invoke a javascript function while executing php-script.

Unfortunately, none of the existing framework for creating web applications, except for Microsoft ASP.NET, normally allows to invoke javascript functions implemented inline of a html document from any specific scripts such php-based or even node.js, etc.

Thanks :)

Arthur.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900