??? Tabular Data Control (TDC): This is a simple DSO that provides access to formatted text files. That is, the data source provided by TDC is a text file that is formatted with a specified separator. ????? It can be applied to all browsers above IE4.0, and he also created a simple database (such as PHP MySQL) that does not require server-side scripting, just a simple application client script If JavaScript can operate TDC. But if your browser is NS, then you have to install a plugin has got the same effect.
?? TDC application template:
??? .........
?????, like Applet, any Object must have parameters, TDC has about eight parameters, here I don't want to introduce one, I only introduce 5 important parameters:
1, DataURL: • You want to read the path of the text, for example: c: /data.txt
2, Useheader: Get the column name of the data to output in the first line of the file
3, TextQualifier: Determine a specific symbol surrounded by your data, for example ~ zhaoweiwei ~, here is "~" as this symbol
4, FieldDelim: Symbols for dividing two adjacent data in a row
5, Rowdelim: Determine a symbol already indicates the end of a line, the default value is: Retail
For example, as follows:
// The file // column name of the data to read is separated by "|" symbol.
YourDataFile.txt content
Name | AGE ~ premshree pillai ~ | ~ 19 ~
Let's introduce the actual application and its advantages:
If I want to display a form in a web page to store my contact, but I don't want every time I increase the new content or modify the previous content, I will modify my web page, and this less content is also There is no need to use the database like the database, so the TDC method has become my own choice.
Remember to put your * .txt file and your web page (* .htm) file in the same directory, first build a txl.txt file (in accordance with the format above), as follows:
Name | AGE | Phone | QQ | Mail
~ Zhao Guan Nan ~| ~ 22~| ~ 1381303698~| ~ 231312~|zhaogn@sina.com
~ Yang Xu ~|~22~|~1393023698 ~| ~ 122256312 ~| Yangx@sina.com
~ Han Hongli ~| ~ 23 ~| ~ 138136556~| ~8297312 ~|Hanghl@sina.com
Here I only record a few information, and I will not write more for the insight.
Then start building our web page (TDC_EX.HTM) as follows:
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
// DataSRC is the data source of the data to read, as starting with the beginning of the statement
?
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????
/ / Represent each column name, the first line of TXL.TXT file
??
????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Name: Age: Tel: QQ: Email:
?
Finally, the results were obtained:
Name:
Age:
Phone:
QQ:
Email:
Zhao Guannan
twenty two
1381303698
231312
Zhaogn@sina.com
Yang Xu
twenty two
1393023698
12256312
Yangx@sina.com
Han Hongri
twenty three
138136556
8297312
Hanghl@sina.com