Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
16
rated 0 times [  19] [ 3]  / answers: 1 / hits: 24773  / 7 Years ago, wed, june 28, 2017, 12:00:00

I have variable which i am getting from DB string url, But the url does not have quotes to url i need to add the quotes to it below is my code.



 var audioUrl
url is having string like http://xxxxx/xxx/xx-xx-123.m4a without double quotes
audioUrl= (data.url)

i need convert data.url value to http://xxxxx/xxx/xx-xx-123.m4a

Circle Jplayer
var audio=http://xxxxx/xxx/xx-xx-123.m4a
var myOtherOne = new CirclePlayer(#jquery_jplayer_2,
{
m4a: audio,
}

More From » jquery

 Answers
23
var audioUrl = + data.url+  ; 


Whatever your get audioUrl and you want to wrap it with , you need to put them and escape inner ones with . Above will result in:



 http://xxxxx/xxx/xx-xx-123.m4a


OR if you are using the single quotes then no need to use the escape character.



var audioUrl = ''+ data.url+  ''; 

[#57282] Saturday, June 24, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jonrened

Total Points: 627
Total Questions: 114
Total Answers: 99

Location: Zimbabwe
Member since Thu, Jul 21, 2022
2 Years ago
jonrened questions
Mon, Nov 2, 20, 00:00, 4 Years ago
Tue, May 19, 20, 00:00, 4 Years ago
Tue, Jan 21, 20, 00:00, 4 Years ago
Thu, Nov 7, 19, 00:00, 5 Years ago
;