Frage

I'm using a jQuery Easyui datebox and use the value as queryparam in an url.

var date = $('#dd').datebox('getValue');
window.open('file.php?date='.date);

I leave the datebox empty and fire the code. When I check file.php in IE 8.0 I get $_GET['date']='1970-01-01' but in Chrome v32.0 it is $_GET['date']='0';

Can anyone explain why and give a hint so I can send the same value with the url?

War es hilfreich?

Lösung

you could add this to make sure to send the same value:

var date = $('#dd').datebox('getValue');
if(date == 0 || date == '0' || date == '1970-01-01' || !date)
date = 0; //or '1970-01-01' if you prefer that one.
window.open('file.php?date='.date);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top