dealmaker
12-19-2005, 07:38 AM
Hi,
I am writing a javascript function that insert html code into innerHTML. It's a form, and I need to assign the path of the server file into the <form action="....">. I don't want to hard code the path. How do I use javascript to do it for me? In php, I can user the $_SERVER variable, what about javascript?
function create_form(id) {
var output = "<form action=\"....\".................;
document.getElementById(id).innerHTML = output;
}
Many thanks.
I am writing a javascript function that insert html code into innerHTML. It's a form, and I need to assign the path of the server file into the <form action="....">. I don't want to hard code the path. How do I use javascript to do it for me? In php, I can user the $_SERVER variable, what about javascript?
function create_form(id) {
var output = "<form action=\"....\".................;
document.getElementById(id).innerHTML = output;
}
Many thanks.