Discussion Locked
0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to find out how to make a Javascript or HTML variable to many HTML pages. A JS function prompts the user for a file name, and then stores it in a local variable, path. I was now trying to make this string availiable to both the HTML and javascript sides on many HTML pages...can this be done, hopefully without using cookies :-) thanks a lot!
2 replies
by keith.hall1
You could store the variable within a seperate frame on the screen. If you don't wish the user to see the frame, set the height to 0, hide the frame borders. If the frame is called topframe, and the variable strFilename , and you have a function to set this variable called
setfile(String theFile){
strFilename=theFile;
}
and function called
getfile(){
return strFilename;
}
You can call thse functions from another page on the other frame by using
parent.topframe.setfile("thename.txt")or
alert(parent.topframe.getfile());
Regards
Keith Hall
thanks a lot Keith, great idea! :-D
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending
0 helpful
5 replies
1 helpful
3 replies
0 helpful
1 reply
0 helpful
1 reply
Question Unanswered
PDF vs HTML
0 helpful
0 replies