我仍然混淆了通过Javascript的方式,我试图将变量playnoyes的内容传递给下面的冗长代码行以决定是否自动播放Flash电影,但将其作为我在下面,结果的代码行中有引号中的变量,因此代码没有按预期执行它。我的问题是,如何传递该变量,以便生成的代码行没有引用变量值。使用Javascript语法来传递变量
非常感谢,对于这个问题的不高兴感到遗憾。
var playnoyes='true';
var testtext = "<script type='text\/javascript'>AC_FL_RunContent ('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','320','height','220','id','HTIFLVPlayer','src','HTIFLVPlayer','flashvars','&MM_ComponentVersion=1&skinName=HTI_Skin&streamName=nigel&autoPlay=\""+playnoyes+"\"&autoRewind=true','quality','high','scale','noscale','name','HTIFLVPlayer','salign','lt','pluginspage','http://www.macromedia.com/go/getflashplayer','wmode','transparent','movie','HTIFLVPlayer');<\/script>";
alert (testtext);
非常感谢。它实际上需要围绕+ playnoyes +单引号,但它然后很好地工作,谢谢。 –