4 ms·
Thanks for the suggestion. So the javascript file would basically write the html markup for the widget? How would it handle interaction with the database? Can I
by amrithk 18y ago
Thanks for the suggestion. So the javascript file would basically write the html markup for the widget? How would it handle interaction with the database? Can I use it to write php code as well?
- babyshake 18y agodo not want
- dpapathanasiou 18y agoSo the javascript file would basically write the html markup for the widget? Yes. The text passed to the document.write statement (also note that document.write is not the only thing you could use here) is the html markup you want to display. Just make sure you take care of character entity references (http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_...) in that markup text. How would it handle interaction with the database? You just need to have some process running on your server which can connect to the db, make whatever queries it needs, and generate the javascript file in your web server's htodcs folder (or wherever you set the output target). Can I use it to write php code as well? Just a guess (I really don't know much about php other than a high-level understanding) but you'll probably run into security issues b/c your user's server will have a different domain from your server. I.e., any web client visiting the user's page will (probably) disallow references to executing code on your server. I could be wrong on that last point, though, so you may want to do some more research or just try a few experiments.