jQuery doesn’t load in Firefox

Hello all,

Last day I had a problem with jQuery and Firefox. I had to create a drop-down menu and it worked perfectly fine in Safari and IE but not in Firefox.

My code looked like this:

<script type=”text/javascript” src=”js/jquery-1.4.4.min.js”/>
<script>

//some jQuery code

</script>

The problem is that Firefox wants <script type=”text/javascript” src=”js/jquery-1.4.4.min.js”></script> and not <script type=”text/javascript” src=”js/jquery-1.4.4.min.js”/>.

Hope this helps,

Andrei

Advertisements

CodeIgniter datepicker with JQuery

Hello all,

 

First of all I want to thank all my viewers from the previous post and I hope that post helped them as much as possible.

 

I am currently developing a web application using CodeIgniter. It is a great framework and everything is very well documented and well thought. But nothing is perfect on this world so I found that creating a date picker using JQuery and CodeIgniter could be very painful especially if you are quite new with both these technologies. So let me first explain how you should proceed and make everything work great.

 

1. Download CodeIgniter from their website. You will receive a folder called CodeIgniter_1.7.3 with everything you need in it. Create a folder called assets underneath CodeIgniter_1.7.3 and under assets create 3 folders: css, images, js.

2. Download JQuery and JQuery UI from their website and place jquery-1.4.4.min.js and jquery-ui-1.8.8.custom.min.js under the js folder created above. When you download JQuery UI you will see that under their css folder they have a folder called ui-lightness. Place this one under you css folder created above.

3.  In CodeIgniter_1.7.3/system/application/config you must edit config.php file like this:

$config[‘base_url’] = “http://&#8221;.$_SERVER[‘HTTP_HOST’].”/CodeIgniter_1.7.3″;

This will set your base url to you root folder.

4. Finally lets create the view. Under the  CodeIgniter_1.7.3/system/application/views create a new view. Let’s call it test.php. Edit it as it follows:

 

<html>

<head>

<title>test</title>

<script src=”<?=base_url()?>/assets/js/jquery-1.4.4.min.js” type=”text/javascript”></script>

<script src=”<?=base_url()?>/assets/js/jquery-ui-1.8.8.custom.min.js” type=”text/javascript”></script>

</head>

<body>

<script>

$(document).ready(function() { $(“test”).datepicker(); });

</script>

<form>

<input type=”text” id=”test” name=”test” />

</form>

</body>

</html>

 

So these are the 4 steps you need to follow in order to set up you JQuery running on you CodeIgniter platform. For the controller that will launch the view above you can watch lots of tutorials on CodeIgniter web site and also on YouTube.

Hope this helps.

Andrei.