WebSite X5Help Center

 
PJ R.
PJ R.
User

Text File Read  en

Автор: PJ R.
Просмотрено 1669, Подписчики 1, Размещенный 0  
Тэги: file,text

How can you read the contents of text file and show the contents on your web page ?

Размещено
3 Ответы
Samuel V.
Samuel V.
User

Hello,

Simply by using Ajax & jQuery. First you create a HTML & Widget with the proper size and define its ID (in the ex. 'recipient'). Than you insert, for example a button with its own ID (in the ex. 'button').

Now you insert the jQuery script inside the page (text file included in the ZIP attached) without forgetting to put the path to your text file. 

When pushing the button, the recipient receives the content of the text file.

Читать больше
Размещено От Samuel V.
PJ R.
PJ R.
User
Автор

Thanks Samuel, but I am looking to show the file contents without the user pushing a button.   can link to text file no problem.

When the web page loads I am looking for the contents of the text file to displayed on the main page ?

Читать больше
Размещено От PJ R.
Samuel V.
Samuel V.
User

Hello,

Of course, it's possible. Please find attached the script modified : when the user enters the page, the text file is loaded. I posted a sample at http://depaivanneste.fr/ajax

No more button is required. Only the DIV with the ID   "recipient"

Читать больше
Размещено От Samuel V.