WebSite X5Help Center

 
Dan N.
Dan N.
User

Webpage loaded by AJAX  en

Autore: Dan N.
Visite 1536, Followers 1, Condiviso 0  

Problem: Using code like Javascrip, PHP etc. in WebsiteX5  have been for me a huge problem. The code was often included in the websitex5 page in different places etc. and problem to have a complet overview. Problems when creating the pages with Websitex5. 

Demand: I wanted to separate as much as possible my code from WebsiteX5.

Solution: After different solutions I came up with the best one by using AJAX technology and database like MYSQL. First I create a homepage with all my demands and needs. (no problems to change and add/delete afterwards) then I create a table, text with or without Tab's, etc. as I want. For every page I need to add a string under properties/expert/before closing the body that include my not even a A4 size program CM_settings.php. It even gets info about logged person.

How it works: CM_Settings.php is the main engine that starts the process when a page is opened. The main function for CM_settings.php is to fetch data, send it to the code file for execution. CM_settings.php gets the filename of the page and then goes to the database and read one or more rows from the table and create AJAX activation information. Every AJAX activation information goes to the responding page (my personal code) and what ever gets out from that code show up on a corresponing place wher I have put my <div id="idname"></div>. I seperate these by using a indexnr like idname1, idname2 etc. I must have one or more. CM_settings include. Gets Websitex5 login information, Gets filename of the page, Gets data from Mysql about current webpage. It is easy to edit yourself and add new stuff. Warning! One wrong cange can make that the code does not work.

Personal Code page: Either use ONE page for everything (depends on how huge the program is) or use one page for each webpage. Use for example fx to sort it out in the list.

Database: The database use a few settings. 1) name of current page 2) name of including page (personal code in Javascript, php etc.)  3) Indexnr  4)  aktiv switch (yes, no) 5) parameters (qx,fx,zx) Create more parameters if you want.  

To change from one page to a different page is easily done in the database. Every page can be tested by itself before being used on homepage. The database also give adminsitartors a clear view over which page is calling what page.   

My wish is that someone can create a object of CM_settings so it can be more easily included into Websitex5. 

Maybe Incomedia have a better solution where to put the file unless a object i created. A Object that helps to create the database, and also create more security. Any help is good.  

Postato il
3 RISPOSTE
Esahc ..
Esahc ..
Moderator

Impressive - but why?

Leggi di più
Postato il da Esahc ..
Dan N.
Dan N.
User
Autore

Why? Good questione. For a few reasons.

1. Seperate the basic webb page from code or events, info text.

2. Easy to edit the code when it is in a seperate file.

3. Easier to edit the text in one file rather to go to each file in the webb page. 

4. You do not need to reload the page for forms like input, select etc.

5. Easy to change from one code/text on the fly to another. Change it the database.

6. Easier to see (with Mysql) which page calls what text/code. Overview. 

7. Use same code/text in other webpages since code/text is only logicaly attached. When you change text/code in one place then alla pages makes the changes. 

8. Save easily info/counter which pages are visted.

9. Use Websitex5 for to organise pages. Use CM_technology for the activity between webbpage and server.  

If you just make a few, plain and simple homepages then you do not need it.

Normaly you have to load a new page everytime but with AJAX you do not need to load a new page every time. You do not need to make different webbpages for different information. You can just change the critieri in the database or your code to produce new information on the same page. You can for example create sub DIV's like <div id="demo1">{<div id="demo2"></div><div id="demo3"></div>}</div>. All you have is the first Id="demo1" the other can be created by your code etc.

Why not use ONE menu code for all the other menus? or why not ONE header/footer code for all pages? instead to apply almost the same code to every single page? 

Leggi di più
Postato il da Dan N.