Transferring data from html to java together with a function call

C

Chris K.

Hi,

Setting my first steps into Java, managing my genealogy website.
In the list of names, with the names in anchor tags,
i want a popup window to appear on clicking the name.
With the command <a href="N0001.jpg" target="_blank"
onClick="viewPic(this.href); return false">
i call the javascript below(found on the net and adapted).
The picture appears perfect on the screen, but without name, date of birth,
date of death,..

Q: How can i join these data(name, birth,death,..) in the link or onclick
event so they ar tranferred from html to java for display
in the popup window
In VFP i can do this using by viewpic(this.ref,name,birthdate,deathdate)
and at the start of the function: function
viewpic(this.ref,name,birthdate,deathdate) .
This logic can't i transfer to HTML and JAVA as newbie.

Any help would be appreacited.
A search on the net and google gave no understanding solution for me, to
specialized.

Thanks in advance,

Chris




function viewPic(img)
{
picfile = new Image();
picfile.src =(img);
fileCheck(img);
}
function fileCheck(img)
{
if( (picfile.width!=0) && (picfile.height!=0) )
{
makeWindow(img,spname);
}
else
{
funzione="fileCheck('"+img+"')";
intervallo=setTimeout(funzione,10);
}
}

function makeWindow(img,spname)
{
if (window.screen)
{
var avht = screen.availHeight / 3 * 2;
var avwd = screen.availWidth / 3 * 2;
}
var args= "height=" + avht + ",innerHeight=" + avht;
args += ",width=" + avwd + ",innerWidth=" + avwd;

if (window.screen)
{
args += ",left=" + 20 + ",screenX=" + 20;
args += ",top=" + 20 + ",screenY=" + 20 + ",resizable=yes,
menubar=0, titlebar=0, toolbar=0";
}

popwin=window.open("","_blank",args)
popwin.document.open()
popwin.document.write('<html><head><link rel="stylesheet"
href="../genea.css" type="text/css" /></head>')
popwin.document.write('<body bgcolor="#FFFFFF" background.......')
popwin.document.write('<img border="0" src="'+img+'"
height="250"></a></td></tr>')
.....
popwin.document.close()
 
E

Evertjan.

Chris K. wrote on 05 jun 2005 in comp.lang.javascript:
This logic can't i transfer to HTML and JAVA as newbie.

java != javascript

this NG != about java
A search on the net and google gave no understanding solution for me,
to specialized.

This works fine here:

<script type="text/JavaScript">

viewPic('myPic.jpg')

function viewPic(img) {
picfile = new Image();
picfile.src =(img);
fileCheck(img);
}

function fileCheck(img) {
if( (picfile.width!=0) && (picfile.height!=0) )
makeWindow(img);
else {
funzione="fileCheck('"+img+"')";
intervallo=setTimeout(funzione,10);
}
}

function makeWindow(img) {
if (window.screen) {
var avht = screen.availHeight / 3 * 2;
var avwd = screen.availWidth / 3 * 2;
}

var args= "height=" + avht + ",innerHeight=" + avht +
",width=" + avwd + ",innerWidth=" + avwd;

if (window.screen) {
args += ",left=" + 20 + ",screenX=" + 20+
",top=" + 20 + ",screenY=" + 20 + ",resizable=yes," +
" menubar=0, titlebar=0, toolbar=0";
}
//alert(args)
popwin=window.open("","_blank",args)
popwin.document.open()
t = '<html><head></head>' +
'<body bgcolor="#FFFFFF">' +
'<img border="0" src="'+img+'" height="250">' +
'</a></td></tr>'
popwin.document.write(t)
popwin.document.close()
}
</script>
 
C

Chris K.

Evertjan. said:
Chris K. wrote on 05 jun 2005 in comp.lang.javascript:


java != javascript

this NG != about java


This works fine here:


I'm sorry asking the question not knowing there's a difference between Java
and Javascript
reading in the routine Javascript.
Yes, I know that the routine works, i use it.
I just want to explore things just like i explored VFP comming from dBasIII+
without any courses,
but doing nicely for not being a pro.
I just want to learn something knowing not to gain information on sitting
back.
I started on PC in 1981 from scratch managing now 5 websites (for free=just
for fun and learning things),
making my bussiness administration soft on VFP9.0 just for the fun.

So not to know anything about Java or Javascript i search my way and won't
be satisfied with:
works fine here

So i'll search other places,
thanks for the advice

Chris
 
E

Evertjan.

Chris K. wrote on 05 jun 2005 in comp.lang.javascript:
I'm sorry asking the question not knowing there's a difference between
Java and Javascript reading in the routine Javascript.
Yes, I know that the routine works, i use it.
I just want to explore things just like i explored VFP comming from
dBasIII+ without any courses, but doing nicely for not being a pro.
I just want to learn something knowing not to gain information on
sitting back.
I started on PC in 1981 from scratch managing now 5 websites (for
free=just for fun and learning things),
making my bussiness administration soft on VFP9.0 just for the fun.

So not to know anything about Java or Javascript i search my way and
won't be satisfied with:
works fine here

I wrote "This works fine here", not just "works fine here" meaning the
script I respondesd with to you, after correction.

However, Chis, if you don't clearly state what you want, the anwers
you'll get probably will never satify you.

Dit is een usenet NG, en geen betaalde helpdesk, en de crême de la crême
van de javascript kennis is hier aanwezig. stel je vraag dus opnieuw, en
duidelijker. "Elswhere" will not be better for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top