Hi,
In HTML I have this functioncall: viewpic(img)
In the function in a *.js-file I have: function viewpic(img)
In a document.write() routine (found on the internet) the image is displayed
perfect.
Now I want to put some data below the picture.
For transfer from HTML to the funtion I have:
imagefilename, name, 'date in string'
I presume these must be in 1 string delimited with ','
How van I transfer these three data from HTML to the function and plit them.
Finding:
function viewPic(img)
{
String[] tokens = String.split(",",img);
for (int i = 0, i < tokens.length; ++i) {
System.out.println(tokens[i]);
}
}
but can't get this split to:
var img = imagefilename
var cName = name
var cDate = "date in string"
and how must I join the filename+","+name+","+date to img in HTML
Any help would be appreaciated.
Chris
A VisualFoxpro-er stepping into HTML and Java-world
Andrew Thompson - 06 Jun 2005 13:45 GMT
> A VisualFoxpro-er stepping into HTML and Java-..
That is actually Javascript, a separate and distinct language from Java.
>..world
For further details.. <http://www.physci.org/codes/javafaq.jsp#js>
HTH

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
CK. - 06 Jun 2005 14:22 GMT
>> A VisualFoxpro-er stepping into HTML and Java-..
>
> That is actually Javascript, a separate and distinct language from Java.
>
>>..world
Thanks for the answer,
I learned something today: Java != Javascript
Chris
Manish - 07 Jun 2005 06:05 GMT
You can split string in javascript.
ex.
function divide_string()
{
var where_is_mytool="home/mytool/mytool.cgi";
var mytool_array=where_is_mytool.split("/");
alert(mytool_array[0]+" "+mytool_array[1]+" "+mytool_array[2]);
}
Manish