-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Javascript demo? #349
Comments
Hi @michael-fischer, sorry for the delay. Your example seems right to me. So, I need some more input from you. What browser and OS are you running this on? Which version of the dependencies and globalize are you using? Alternatively, please consider testing out this https://gist.github.com/rxaviers/9fec3ae0dfb7cdb0a0ce (tip: use git clone to fetch these files). |
Please, fell free to add new comments if necessary. |
@rxaviers, I apologize for the delay. I was away last week and just got back to the computer that had my example. Well at least I am consistent. Using your gist I get the same error messages. I have tried hosting in IIS Express and using Python 3.4. I am using Chrome 39 on a Windows 8.1 box. However, I see in 343 that you got your example up and running without any trouble on a windows 8 box (Chrome 37). I'll keep poking around to see what I have gotten wrong. |
How did you get dependencies? |
Oh, an additional note, that I don't think will make a difference, but wanted to include for thoroughness. I have a Scripts folder that contains the extracted dependencies. I of course updated the index.htm file to match - both the script calls themselves, and the get json calls. When running in the Python34 http.server the calls to the js and json files all return a 200 status. I see that while I was typing this you asked how I get the dependencies. I download and extracted the tarball through the web browser. Michael |
Please, try using the gist untouched using the dependencies from |
Same experience. |
Sorry I can't reproduce the bug you're experiencing. As I said in #343, the gist works on:
I also ran it on the browsers and OSes below and it ran just fine.
|
I'm sure I am doing something annoyingly simple - wrong. I am getting a hold of a mac to give it a try. I'll post if I figure out what I am missing. |
Please, do. Thanks. |
I was able to get your sample to work by making a couple of changes to the index.html. Some that probably had no effect on it like making the code more xhtml compliant (adding the missing html opening tag, cleaning an orphan span end tag, etc..) and then modifying the calls to get to state that the return data was JSON. Essentially, I modified the original code.
to
So, Now my question is that when I try to add other cultures that I am interested in (en-US, es-419), is there anything else that I need to do besides copy the data from the CLDR full json? I did this for the above locales and it seems to want the default language loaded as well (en and es respectively). I am confused as to why this might be necessary since the included en-GB works just fine. Michael Fischer |
Use |
@michael-fischer, about other cultures (or more precisely locales), there's nothing else you need to do. Although, you need to load |
I could be wrong but this appears to be associated with Globalize.load in globalize.js. This call Cldr.load.apply( Cldr, arguments ); negates the fact that you executed this in the example: `// Normalize $.get results, we only need the JSON, not the request statuses. I posted what I believe is the same issue - rxaviers/cldrjs#45 I just found this post looking for something else. |
This did trick for me:
|
All, if anyone finds anything wrong in globalize code, docs, and/or examples, please create another issue with details. So far I'm considering this a closed issue. |
Hopefully this is something that is easy to fix. I am trying to evolve the Hello World (Plain Javascript) tutorial to be more dynamic similar to what is outlined in Example of loading it dynamically under how do I get CLDR data. The merged code looks something like the following.
This code errors in the call to
Globalize.load
when it checks for IsPlainObject. It tries to compare the JSON string to"[object Object]"'
I am a back end developer moving into javascript so was hoping you could verify that I am on the right path and my assumptions about a new [to me] language are valid. Perhaps offer a hint as to the changes that need to be made. I tried to look at the test suites but they use other technologies.Thanks,
Michael Fischer
The text was updated successfully, but these errors were encountered: