newbie question

C

CK.

Hi,

Passing params from html to javascript for displaying, the image shows every
time.
The text params passed showing mostly on clicking the link in the HTML
pages.
Sometimes the webpage generated with the rotuine below gives the string vars
as 'UNDEFINED', but they are.
On reclicking the link, they show up!
I suspect a mistake but can't find it.

TIA,
Chris



// JavaScript Document
function viewPic(img,cName,cStraat,cStad,cTelefoon,cFax,cWebsite,cEmail)
{
picfile = new Image();
picfile.src =(img);
var spcName = cName;
var spcStraat = cStraat;
var spcStad = cStad;
var spcTelefoon = cTelefoon;
var spcFax = cFax;
var spcWebsite = cWebsite;
var spcEmail = cEmail;
fileCheck(img,spcName,spcStraat,spcStad,spcTelefoon,spcFax,spcWebsite,spcEmail);

}


function
fileCheck(img,spcName,spcStraat,spcStad,spcTelefoon,spcFax,spcWebsite,spcEmail)
{
if( (picfile.width!=0) && (picfile.height!=0) )
{
makeWindow(img,spcName,spcStraat,spcStad,spcTelefoon,spcFax,spcWebsite,spcEmail);
}
else
{
funzione="fileCheck('"+img+"')";
intervallo=setTimeout(funzione,10);
}
}


function
makeWindow(img,spcName,spcStraat,spcStad,spcTelefoon,spcFax,spcWebsite,spcEmail)
{
ht = picfile.height;
wd = picfile.width;
if (window.screen)
.....
popwin=window.open("","_blank",args)
popwin.document.open()
popwin.document.write('<html><...
....
popwin.document.write('<hr></body></html>')
popwin.document.close()
}
 
V

VK

function viewPic(img,*cName*, ...)
but:
fileCheck(img,*spcName*, ...);

Make sure that you're using the same names for the same vars, and it
will work. (Or it still will not work but for another reason :)
 

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,073
Latest member
DarinCeden

Latest Threads

Top