Hello,
I revised my previous discussion code by simplifying it.
controllers/page.php
<?php
class Page extends CI_Controller {
public function index()
{
echo "Controller loaded";
$this->load->view('homepage');
}
}
?>
views/homepage.php
<!DOCTYPE html>
<html lang="en">
<head>
<link href= "<?php echo base_url('assets/css/style.css'); ?>" rel="stylesheet" type="text/css" media="screen">
</head>
<body>
TEST
</body>
</html>
assets/css/style.css
$('body').css('background-image', 'url("<?php echo base_url('assets/images/indonusa3.jpg'); ?>")');
RESULT:
Controller loaded
I wonder why the background image does not load. The following file does exist: assets/images/indonusa3.jpg . Also the text "TEST" does not appears if I add:
<link href= "<?php echo base_url('assets/css/style.css'); ?>" rel="stylesheet" type="text/css" media="screen">
in the html in homepage.php