jQuery UI:日期选择器.如何通过$ _GET在日期选择器中设置日期 [英] Jquery UI : date picker. How to set date in date picker by $_GET

查看:106
本文介绍了jQuery UI:日期选择器.如何通过$ _GET在日期选择器中设置日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到如何设置$ _GET变量以在日期选择器中手动设置日期的方法. http://jqueryui.com/demos/datepicker/

I can't find how I can set $_GET variables to set manually the date in the date picker. http://jqueryui.com/demos/datepicker/

(例如: http://www.something.com /?day = 21& month = 2& year = 2010 )

有可能吗?

谢谢

推荐答案

在此链接中使用gup函数读取get参数.然后调用setDate方法(省略错误处理):

Use the gup function in this link to read the get parameters. Then call the setDate method (error handling omitted):

$(function() {

  $("#Datepicker").datepicker();
  var year = gup("year");
  var day = gup("day");
  var month = gup("month");

  $("#Datepicker").datepicker("setDate", month + "/" + day + "/" + year);

});

这篇关于jQuery UI:日期选择器.如何通过$ _GET在日期选择器中设置日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆