In a php file i have used include to include the following js.php file and prior to that i have included the jquery file.
include
instead of $( document ).ready( function() { ... } );
try
$( document ).ready( abc() );
function abc() { .... }
worked for me.i myself searched lot of places, but couldn't find a solution. Tried this out randomly and worked!!