如何为Jquery加载的php脚本设置CSS

I have a js function as below:

 function show() {
      $(document).ready(function() {
          $('#container').load('show_my_file.php');
          $('head').append( $('<link rel="stylesheet" type="text/css">').attr('href','show_my_file.css') );
      })
 }

This function is supposed to load the show_my_file.css to render #container (which now loads show_my_file.php), but it didn't work.

Does anybody how to how solve it? Thanks in advance.

the only thing i see wrong is the load(show_my_file.php); it should be

$('#container').load('show_my_file.php');

it worked with for me.

Try this

  $('#container').load("show_my_file.php");

The file or path to the file should be in quote " "

$(document).ready(function() {
   function show() {
      $('#container').load('show_my_file.php');
      $('head').append( $('<link rel="stylesheet" type="text/css">').attr('href','show_my_file.css') );
   }
});