R和Ajax交互

I currently process a set of text files using R. The output of this process is a js file, call it: preparedData.js.

I then use preparedData.js as the input to an html file,

<script type="text/javascript" src="js/preparedData.js"></script>

call it myviz.html which shows a visualization of the data in preparedData.js.

I want to generalize this process so other people can enter their text files on a web page, my R script will prepare the preparedData.js for them, and then provide a link to a new webpage with their visualization on it. So I need to provide a link to a new webage which is a copy of my myviz.html, call it theirviz.html, with the location of their .js file as the input.

I don't have much server interaction experience and I know this is vague but how can I accept the text files as input, launch the R script when they submit the form, and then create the web page with their preparedData.js driving the results?

Thanks!

Instead of creating different html file for every user, you should use a server side scripting language like php. You can create js files with different name for each user. And instead of creating an html page for each user you can create a single php page which takes js file name from session. You can save name of the js file created for a user in session and use it in the php page.

Hope I understood your problem correctly.