Reply
String syntax problem.
Old 10-29-2007, 02:54 PM String syntax problem.
Super Talker

Posts: 129
Hi all, I'm playing around with functions, trying to learn a bit. I've got a function, below:
Code:
function BigPhoto(source,width,height){
 var source
 var width
 var height
 var newWindow = window.open("", "Bob", 
        "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, width=" + width + ", height=" + height + ", scrollbars=no");
    newWindow.document.writeln("<html>");
    newWindow.document.writeln("<img src='" + source + "'/>");
    newWindow.document.writeln("</body></html>");
    newWindow.document.close();
}
and am trying to pass parameters to it through this line of code for the "onClick" behaviour:
Code:
onClick="MM_callJS('BigPhoto('Images/People/Large/Bob.jpg',800,533)')"
If I take the variable "source" out, and put the img src as the string Images/People/Large/Bob.jpg then there is no problemj, which tells me that the problem lies with the quote marks (type of, number of etc) in the onClick code.
Can anyone point me in the right direction please? I've tried just about every permutation I can think of!

Cheers, Lol
__________________
www.17minutes.co.uk - Street Photography
Lol999 is offline
Reply With Quote
View Public Profile Visit Lol999's homepage!
 
When You Register, These Ads Go Away!
Old 10-29-2007, 05:12 PM Re: String syntax problem.
Insensus's Avatar
Ultra Talker

Posts: 275
Name: Mark Stegeman
Location: Netherlands, Europe
onClick="MM_callJS('BigPhoto(\'Images/People/Large/Bob.jpg\',800,533)')"
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 10-30-2007, 06:29 AM Re: String syntax problem.
Super Talker

Posts: 129
Thanks Mark, I've got it sorted!

Cheers, Lol
__________________
www.17minutes.co.uk - Street Photography
Lol999 is offline
Reply With Quote
View Public Profile Visit Lol999's homepage!
 
Reply     « Reply to String syntax problem.
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.45114 seconds with 12 queries