3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <meta content="utf-8" http-equiv="encoding">
    <link rel="stylesheet" href="https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script language="Javascript" type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script>
    <script language="Javascript" type="text/javascript" src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

    <style type="text/css">
        .ui-datepicker { font-size: 62.5%; }
    </style>

    <script>
    $(function() {
        $("#StartDate").datepicker({ dateFormat: "yy-mm-dd" }).val();
        $("#EndDate").datepicker({ dateFormat: "yy-mm-dd" }).val();
    });
    </script>
 </head>
  <body bgcolor='#6a7c99'>
<input id='StartDate' type='text' style='position:absolute;top:35px;left:92px;width:55px;font-family:arial narrow;font-size:8pt;display:none;' name='StartDate'>
  <input id='EndDate' type='text' style='position:absolute;top:75px;left:92px;width:55px;font-family:arial narrow;font-size:8pt;display:none;' name='EndDate'>
  </body>
</html>

This code does not work. $function() does not work and throws an error. Whats wrong? What other jQuery libraries should be included?

2
  • 2
    jQuery was not properly loaded Commented Jun 17, 2013 at 22:44
  • 1
    Change https:// to // and it should work fine. Your protocols are probably mismatched. Commented Jun 17, 2013 at 22:44

1 Answer 1

5

Looks like the links for jquery and jquery ui are throwing a 504. Hence the error. https:// does not work.

Try this:

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script language="Javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script language="Javascript" type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
Sign up to request clarification or add additional context in comments.

3 Comments

https does not work either, since my server is secured and has SSL certificate it blocks any http. However $(document).ready(function()) works fine. Please suggest me what to do!
Please suggest how to use jquery and jquery ui links in a secured server!
That is exactly what I told you. Download all the files into a folder where you have your static files. If you don't create a new one. And point to that instead of the current link you are using

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.