3

I am newbie working on a 100% js prototype. It consist of 3 docs: an html page full of xml tags, a small dictionary in a text file format, and a js file with jquery.

The js needs to parse the xml tags (no problem here) and look into the mini-dictionary list for available translations.

Which is the best way to implement the mini-dictionary list. (No more than 50.000 records). Is there a way to load the list into a memory database and access it from js? Which is the usual path to take in this case? What is the simplest and machine-independent way to do this?

Any directions as to where should I research are greatly appreciated.

1
  • Is this JS in the browser? If not, what server side JS is this? Commented Sep 4, 2011 at 17:23

1 Answer 1

3

I would suggest encoding mini-dictionary with JSON data format, and then using AJAX to get that file and parse it. But then you are risking someone will just copy whole dictionary and steal your work.

That is, if you are not using server side language, like PHP. If you are using it, then just store everything into database and request just specific words with AJAX.

Sign up to request clarification or add additional context in comments.

6 Comments

You wouldn't necessarily need to load it with AJAX, it could just be included as a .js file.
Great idea! Yes, but as I said, then someone will just copy everything like 1-2-3 if he doesn't use server side service. You know that I mean?
That's not what the OP is concerned with. The OP appears to want it to run entirely in the browser, without server scripts, and has not mentioned anything about being worried someone would steal the database.
Well, he maybe is, but he doesn't know it yet :D
No worry about stealing since this is an extract of a much bigger dataset, and the ownership of this mini-dictionary goes to the client of the 100% app. This is to be a complete solution to run in the client without server interaction. Thanks Jared and Rok.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.