javascript - Codeigniter: page background won't load upon submit error -
i have login page includes simple js file load <body> background image. if open login page, works fine. when login error occurred or register error occurred, page not load background image. login page loaded in welcome controller:
public function index() { $this->load->view('index'); } and same page loaded in login/register controller this:
if ($this->form_validation->run() == false) { // validation fail $data = array( 'error_message' => 'please check inputs.' ); $this->load->view('index', $data); } i did notice when submission error occurred, url of re-loaded index page http://localhost:8080/cashflow/index.php/login/index while normal index page url should http://localhost:8080/cashflow/index.php
so, how have js file run background image loaded.
thanks,
maybe must review jsor images file url path.
are locate js right place? like:
<script url="<?php echo base_url('path/to/js.js');?>"></script> please note path js file when access link //localhost:8080/cashflow/index.php/login/index path same visit link //localhost:8080/cashflow/index.php.
like that, should check url path of images background set in body tag, style="background: url(/path/to/background.jpg) center top norepeat;"?
please note path must lead image or js selected.
hope help.
Comments
Post a Comment