Ok, my first thread?
Having worked extensively with C++, VB, and PHP, I am now trying to figure out the quirks of JavaScript, too. My current dilemma is trying to understand how I can best update and refresh displayed text on a JavaScript generated window.
Here is what I want to do – Display a small pop-up window that shows a grammatically correct sentence in a foreign language. The user can click on a button on the window for another example of the particular grammar topic, and the window would refresh and display another example. So bascially there would be a text field, a “Gimme Another” button, and a “Close” button.
I already have completed the code (in VB, need to port to JavaScript) for all of the grammar calculations, so that part is basically done. What I DON’T want to do is do the grammar calcs server side (via PHP) because they are intensive and don’t want the load on my server and the bandwidth usage every time the user clicks “Gimme Another”.
When I try to print to the same window (via document.writeln) with updated HTML, naturally the script only works once. Do I need to use frames and two separate HTML files, one for the display and one for the main JavaScript code?
Any ideas/suggestions would be greatly appreciated.
Thanks!