我有一些小的javascript,应该带一些值来改变链接,但问题是日期格式写成:dd / mm / year因此日除以月然后按年:)这里是函数:
function show_sales(employee_id,start_date,finish_date)
{
var url_str = "#request.self#?fuseaction=objects2.popup_showsales_emp"
url_str = url_str + '&employee_id=' + employee_id;
url_str = url_str + '&start_date=' + start_date;
url_str = url_str + '&finish_date=' + finish_date;
AjaxPageLoad(url_str,'salesdiv_' + employee_id,1,'Yükleniyor');
}
因为你可以看到我想得到开始日期和完成日期来更改链接,但相反它计算值))所以而不是得到:02/01/2012我得到:0.0009940357852882703 :)谢谢大家帮助!
答案 0 :(得分:2)
我希望函数调用有一个概率
function show_sales(1,'12/3/2008','15/5/2012');
确保将日期格式化为字符串
答案 1 :(得分:0)
我不太确定我是否了解你,但这可能有所帮助:
function show_sales(employee_id,start_date,finish_date)
{
var url_str = "#request.self#?fuseaction=objects2.popup_showsales_emp"
url_str = url_str + '&employee_id=' + encodeURIComponent(employee_id);
url_str = url_str + '&start_date=' + encodeURIComponent(start_date);
url_str = url_str + '&finish_date=' + encodeURIComponent(finish_date);
AjaxPageLoad(url_str,'salesdiv_' + employee_id,1,'Yükleniyor');
}