javascript - PHP require_once() .js file -



javascript - PHP require_once() .js file -

okay, i'm using require_once load contents of .js file. however, there seems 1 added end of file after require done.

php:

echo require_once("test.js");

js:

var newfunc = function() { console.log('yay!'); };

rendered html when php file loaded:

var newfunc = function() { console.log('yay!'); };1

require_once() returns 1 if include successful. you're echoing homecoming value, not thought was.

use file_get_contents() instead, although odd usage, you're heading in wrong direction whatever you're trying this...

javascript php require-once

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -