views:

143

answers:

1

Hi,

I'm trying to use the following plugin for date picking:

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html

And I'm trying to use the code from the first demo but I get an error that jQuery is not defined (last line of the plugin, where the function is closed).

I haven't used jQuery before so I'm hoping this is a simple error.

I've tried to call it as follows:

<script type="text/javascript" charset="utf-8">
$(function()
{
 $('.date-pick').datePicker();
    }
</script>

^ Inside the head of the page. There is also other jQuery code in the head, could this be causing a problem?

The plugin and other required JS are all present.

Adam

+2  A: 

Try this:

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
        $('.date-pick').datePicker();
})
</script>
mck89
In the code that you have written the ) is missing after }
mck89
sorry that was a mistake in me copying the snippet, and I've tried you're suggestion and I still get the same error :(
Adam Taylor
It seems like the JQuery.js file isn't iclude or there are some conflicts. Are you using other JS frameworks?
mck89