enesser / vCards-js

Create vCards to import contacts into Outlook, iOS, Mac OS, and Android devices from your website or application.
MIT License
419 stars 154 forks source link

TypeError: Object 98366 has no method 'replace' #14

Closed vacarsu closed 9 years ago

vacarsu commented 9 years ago

I get this error when using workAddress fields.

enesser commented 9 years ago

I wonder if you don't have strings in your address fields. What does your address code look like?

vacarsu commented 9 years ago

They are string, are they not supposed to be?

enesser commented 9 years ago

They should be strings. Try out the example code in the README or look at the unit test: https://github.com/enesser/vCards-js/blob/master/test/tests.js

vacarsu commented 9 years ago

I found the problem I was setting the city code to be a number instead of a string

enesser commented 9 years ago

Added code to convert other data types into a string in the encode method, because this sounds like a mistake that others will experience.

Thanks.