Set JavaScript file to a variable in PHP -


okay i'm trying set javascript document variable in php?

essentially i'm setting wifi speed calculate in javascript document variable,so can save variable value in database other information instance.

the javascript code pretty long don't know if should copy whole code in , set equal variable or if there's syntax set variable.

i've seen:

<script type="text/javascript" src="file.js"></script> 

online calling javascript file not sure how value , store in variable.

you

$js = file_get_contents( 'http://www.example.com/javacsript.js');  $value = trim( str_replace( array( "document.write('", "');"), '', $js));  echo $value; 

hope you


Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

jquery - jqGrid update specific column data with out refreshing the entire column? -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -