Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writeln

Status
Not open for further replies.

novice2004

Programmer
Feb 2, 2004
62
US
Help please.
I am confused with '".
The following does not work.

writeln('document.mainimage.src = "' + imgSrc + 'picture' + currentPicture + '.jpg";');

Thank you.
 
Remove the single quotes around picture.

There's always a better way. The fun is trying to find it!
 
novice2004,
I don't see any problem whatsoever with your code. In fact, I tested it and it works as expected. Everything should work just fine unless your variables (imgSrc, currentPicture) aren't declared properly.

By what I see, you want to include the word 'picture' as part of the name of the *.jpg file and have a semicolon at the end of the line. If that's what you want, that's exactly what the code does.

What error message, if any, are you getting? What exactly is the problem? Before you try anything, make sure your variables are initialized property, as I the code is syntactically correct.

JC


Friends are angels who lift us to our feet when our wings have trouble remembering how to fly...
 
I'd suggest you use an alert to see what's happening. You know what the syntax for the link should look like, so see how it differs and work backwards from there.
Code:
alert('document.mainimage.src = "' + imgSrc + 'picture' + currentPicture + '.jpg";');

-kaht

banghead.gif
 
Code is in php file.
The only error I get is "error on page".
Otherwise the page is empty.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top