I building a simple, 7 page, database driven, website, and I would like to build a simple CMS for it. A super simple CMS just for changing the text on certain pages and uploading images to another. I wouldn’t even go as far as to call it a CMS. I mostly doing it for the learning experience of building a web app.
What I was thinking, is using php to build a simple web page that would have some simple login handling. Then use ajax to load the different modules for each page. Like on the main page I would like only the text to be changeable. What I thought I could do was use ajax to load another php page that just loads up a tinymce editor and preloads it with the text that is in the database, with a simple ajax button to upload the text to the database. Similar to a iframe but with out the iframe.
When I attempted this all I got was some text and textarea box. Turns out it only loads text not javascript. upon further reading I found out I could use eval to transform the text loaded into javascript, but this leads to scope issues from what I understand.
So I’m basically wondering how do I do this my goal is something similar to google and/or yahoo mail apps. I thinking at first I could throw all the javascript code I’m going to use on the main page and just load content with ajax, but from what I have read the javascript won’t apply its self to the new code since it wasn’t there when the code was applied to the DOM elements sometime when the page first loaded. My next thought was to load the content then load the script using jquery and apply it to the newly loaded content, but attempting to find anything on that was confusing at best.
Has anyone done anything similar to this and is willing to share what they learned, or just know what I’m talking about and can help me out? Or is the solution simple and I’m just not seeing it?
We could use a little more detail (like code, procedures, etc.) however, i’d like to help out.
regarding the tinymce, here’s my take on it:
in all, there is 2 calls: a call for the editor and after it, the default content.
You can use preloaded scripts to do what is needed before loading any content. create scripts to handle DOM, events, etc (event handlers).