This works for me: function jscript1(){ var theString = "screen1.cfm";
var fileName = theString.substring(0,theString.lastIndexOf(".")); callURL = "<a href=\"##\" onclick=\"javascript:return parent.frames[1].XYZ(\'" + fileName + "\')\">Link1</a>"; alert(callURL); } On 4/15/2010 5:14 PM, fun and learning wrote: > >> callURL = "<a href='##' onClick='javascript:return parent.frames[1]. >> XYZ(\"" + fileName + "\")'>Link1</a>"; >> >> Does not work..Shows syntax error. >> >> On 4/15/2010 4:58 PM, fun and learning wrote: >> >>> Hi All, >>> >>> I know this is coldfusion forum, but can any one tell me what I am >>> >> missing to make the fileName get within quotes in javascript. I am >> getting everything right except in callURL, the fileName is sent as >> argument, but the real value is not enclosed within quotes. I tried >> different combinations but its not working. the actual callURL value >> when outputted should be >> >>> <a href='##' onClick='javascript:return parent.frames[1]. >>> >> XYZ("screen")'>Link1</a> but the value I am getting right now is >> >>> <a href='##' onClick='javascript:return parent.frames[1]. >>> >> XYZ(screen)'>Link1</a> >> >>> Below is the code: >>> >>> function jscript1(){ >>> var theString = 'screen1.cfm' >>> >>> var fileName = theString.substring(0,theString.lastIndexOf(".")); >>> >>> callURL = "<a href='##' onClick='javascript:return parent.frames[1]. >>> >> XYZ(" + fileName + ")'>Link1</a>"; >> >>> } >>> >>> >>> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332932 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm