Buttons Error (Uncaught TypeError: str.replace is not a function)
Buttons Error (Uncaught TypeError: str.replace is not a function)
Seann
Posts: 6Questions: 0Answers: 0
Hi Allan,
Really looking forward to this release. .I am getting an error in chrome when I click on any of the buttons.
Uncaught TypeError: str.replace is not a function or 'a.replace is not a function' if using the minified version
datatables.js : 92018
if ( config.stripHtml ) {
str = str.replace( /<.*?>/g, '' );
}
This discussion has been closed.
Replies
I have the same problem, debugging with firebug it seems to str.replace when str is number object... using: //cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.js
Thanks! I'll get a commit in for this shortly.
Allan
I just updated from the download builder, I have exactly the same problem.
Hi,
I've committed the required fix, but the download builder will use the release version rather than latest check in. I'm going to make a release of Buttons 1.0.1 with this fix, and others, at the end of the week. Until then you can either include the fixed file locally or patch your local version.
Allan
Thanks for the very fast reply!!
I just tried the CDN and all I'm getting for datatables.min.js is Error: Build is incomplete
Anyway, great work the improvements look very exciting
Embarrassing code mistake in code that no one will ever see ;-). It is fixed now and you shouldn't see that error now!
Thanks,
Allan
Works beautifully.
Thank you again Allan.
I'm very happy that my switched-on users can say goodbye to flash!
I believe the correct code should be, since server-side processing is not strictly required to return strings, but your export code requires it:
If possible, consider also including this for stripHtml:
That is the fix - although I didn't cast it to be a string as I didn't think that was needed.
Converting HTML entities sounds like a good idea. I wonder if it can be generalised. I'll look into that.
Allan
Hi allan, i had the same error with the latest versión 1.10.9, the only way that worked for me was with the cast that N4M3Z said,
return String(str);
thanks,