Page 1 of 1

why are my .js files not loading?

Posted: Tue Jul 24, 2012 12:55 pm
by kc11
Hi everyone,

I am working with codeigniter 2.1 and twitter bootstrap on a site. I want to load 2 views sequentially to form a single html page, like so:

Code: Select all

$this->load->view('view1');
$this->load->view('form');              
This appears to work fine except I notice that the form which I am appending onto the first html view does not appear to load its javascript:

Code: Select all


</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="blueimp/js/vendor/jquery.ui.widget.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="http://blueimp.github.com/JavaScript-Canvas-to-Blob/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS and Bootstrap Image Gallery are not required, but included for the demo -->
<script src="http://blueimp.github.com/cdn/js/bootstrap.min.js"></script>
<script src="http://blueimp.github.com/Bootstrap-Image-Gallery/js/bootstrap-image-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="blueimp/js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="blueimp/js/jquery.fileupload.js"></script>
<!-- The File Upload file processing plugin -->
<script src="blueimp/js/jquery.fileupload-fp.js"></script>
<!-- The File Upload user interface plugin -->
<script src="blueimp/js/jquery.fileupload-ui.js"></script>
<!-- The localization script -->
<script src="blueimp/js/locale.js"></script>
<!-- The main application script -->
<script src="blueimp/js/main.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->
<!--[if gte IE 8]><script src="js/cors/jquery.xdr-transport.js"></script><![endif]-->
</body> 
</html>

-------------------- end of 'view1'

----------form begins here



	<form action="http://localhost/bootstrap1/index.php/site" method="post" accept-charset="utf-8" id="form3" class="form-horizontal"><fieldset>
	<legend>Form3</legend>
	<div class="status"></div>
	
<div class="control-group">
	<label class="control-label" for="a">a</label>
	<div class="controls">
		<input type="text" value="" name="a" id="a" placeholder="a"  />
		<span class="form_error" id="a_error"></span>
	</div>
</div>
<div class="control-group submit_group">
	<div class="controls submit_controls">
		<button type="submit" class="btn btn-primary" id="submit">Save</button> or <a href="javascript: window.history.go(-1)">Cancel</a>
	</div>
</div>
</fieldset>
</form>
<script> src="js/jquery.js" </script>
<script> src="js/plugins.js" </script>
<script> src="js/form_builder.js" </script>
<script> src="js/form_builder_functions.js" </script>
<script> src="js/array_functions.js" </script>
<script> src="js/form3.js" </script>


Can Anyone tell me why the following do not load?

Code: Select all

<script> src="js/jquery.js" </script>
<script> src="js/plugins.js" </script>
<script> src="js/form_builder.js" </script>
<script> src="js/form_builder_functions.js" </script>
<script> src="js/array_functions.js" </script>
<script> src="js/form3.js" </script>
Thank you,

KC

Re: why are my .js files not loading?

Posted: Tue Jul 24, 2012 1:19 pm
by tr0gd0rr
look at the script tags above. src is an attribute of the <script> tag, not something that goes inside it.