Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

Newbie question

Thread view: 
CK. - 06 Jun 2005 12:46 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.