Welcome Guest, Not a member yet? Register   Sign In
Multiple view loding not working on FF or Chrome
#1

[eluser]mass1023[/eluser]
when I load multiple views like this:

Code:
$this->load->view('header_view');
$this->load->view('home_view');
$this->load->view('footer_view');

In Opera it works fine, but in FF and Chrome it only loads the header_view and doesn't display
any errors or warnings.

This is my header file:
header_view
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
        &lt;title&gt;Code Igniter&lt;/title&gt;
        &lt;script type="text/javascript" language="javascript" src="&lt;?=base_url()?&gt;system/application/js/page.js" &gt;
    &lt;/head&gt;
    &lt;body&gt;
        <div class="container">
#2

[eluser]mass1023[/eluser]
I found that the problem is when I call the javascript file, but still dont understand why the problem persists.
#3

[eluser]Cristian Gilè[/eluser]
Quote:
Code:
<5cript type="text/javascript" language="javascript" src="&lt;?=base_url()?&gt;system/application/js/page.js" >

It's not a good practice call the js file from a folder inside application. Place the assets folder outside application as follows:

Code:
|__index.php
|__assets
    |__js
    |__img
    |__css
|__system
    |__application
        |__controllers
        |__models

<5cript type="text/javascript" language="javascript" src="&lt;?=base_url()?&gt;assets/js/page.js" ></5cript>


Cristian Gilè
#4

[eluser]mass1023[/eluser]
Thank's I'll change the directories.




Theme © iAndrew 2016 - Forum software by © MyBB