javascript - unterminated string literal error in jquery -


the following code inside script tag in php while loop.

<?php  //while loop starts here { ?> <script type="text/javascript">     $(document).ready(function(){       var url = "<?php echo $cfile;?>";      var mycircleplayer = new circleplayer(         '#jquery_jplayer_<?php echo $row_data['id'];?>',         { '<?php echo $extension;?>' : url },          { cssselectorancestor: '#cp_container_<?php echo $row_data['id'];?>',            swfpath: 'js',            wmode: 'window',            supplied: '<?php echo $extension;?>'         });      }); </script> <?php } // while loop ends here ?> 

so facing problem in line -

var url = "<?php echo $cfile;?>"; 

where $cfile url. , value this. (but in loop, vary every time.)

$cfile= "http://www.domainname.com/foldername/wp-content/uploads/mp3 file name"; 

so error showing-

syntaxerror: unterminated string literal  var url = "http://www. 

please note that- not getting error every time, error on specific ids. issue & how solve ?

i javascript part after php parsing.

<script type="text/javascript"> $(document).ready(function(){ var url = "http://www.redfacilities.com/redfacilities/wp-content/uploads/2013/10/alexisgraham.mp3"; var mycircleplayer = new circleplayer('#jquery_jplayer_66',{ 'mp3' : url }, { cssselectorancestor: '#cp_container_66', swfpath: 'js', wmode: 'window', supplied: 'mp3'}); }); </script> 


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -