views:

437

answers:

2

I am using the jQuery Date Range Picker by the filament group.

My code is such that I'm dynamically creating a textbox or rather an AJAX query returns HTML of a form. When I dump the HTML onto my page I call a script that invokes the daterangepicker() function supposed to turn an inputbox into a date range picker.

My code works perfectly fine in Firefox and Internet Explorer, however it just dies in Google Chrome. The script doesn't run and I get this error in the logs:

Uncaught Error: INVALID_NODE_TYPE_ERR: DOM Range Exception 2

What could be the problem here? I really need to fix this - the exception is thrown within the core jQuery code. The date picker seems to work fine when I view the site demo.

You don't suppose it has something to do with being called to attach to an element that is created by an AJAX query at run time. Whatever the issue I need to get this working pronto and would appreciate any kind of help.

+1  A: 

several people report that this functionality is broken in Chrome. Maybe you should look out for alternatives.

Konstantinos
I don't know - because it works perfectly fine when on its own on a page in chrome. The demo is working fine with no issues atleast. However in my case I am creating an input box at run time and then making the datepickerrange call which seems to be failing - plus the error message I get is tracing to the jquery library :\
Ali
tough luck mate. =/
Konstantinos
+2  A: 

Hi Ali,

I had the same problem, and Chrome debugger notes the error is in the Jquery library version 1.3.2

I looked at the source for filaments daterangepicker demo page, and it turns out they are using jquery library 1.3.1

... src="js/jquery-1.3.1.min.js"

I ran a test using 1.3.1 instead of 1.3.2 and that worked for my site.

I recommend to test for browser and use 1.3.1 in the case that the user is using chrome.

All the Best, Yehuda

WOW! Thanks for the great insight man. Will definitely try out your findings - never occurred to me to actually go deep in and check out what the official filament group website was running.Thanks again man :D
Ali