Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



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

Posts: 129
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
- Street Photography
Lol999 is offline
Reply With Quote
View Public Profile Visit Lol999's homepage!
 
 
Register now for full access!
Old 10-29-2007, 06:12 PM Re: String syntax problem.
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
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, 07:29 AM Re: String syntax problem.
Super Talker

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

Cheers, Lol
__________________

Please login or register to view this content. Registration is FREE
- Street Photography
Lol999 is offline
Reply With Quote
View Public Profile Visit Lol999's homepage!
 
Reply     « Reply to String syntax problem.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.29516 seconds with 12 queries