Jump to content

Including the Java script


freshbee

Recommended Posts

Dear Friends,

        Can I write a function in php which includes all the javascripts. And call that function wherever necessary.

Ex :

[pre]class USER {

 

        public function include_js_files() {

                echo "<script language=javascript src=../scripts/IsValid.js></script>";

                echo "<script language=javascript src=../scripts/IsAlpha.js></script>";

                echo "<script language=javascript src=../scripts/IsEmail.js></script>";

      }

        public function edit_user($user_id,$role_id) {

 

              self::include_js_files();

              .....

              echo "<form id=1 onsubmit='return chk_input();' method=post action='edit.php'>";

              .....

              .....

        }

}[/pre]

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/145036-including-the-java-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.