вставлять код в ошибку AJAX - PullRequest
       0

вставлять код в ошибку AJAX

0 голосов
/ 01 сентября 2011

Я пытаюсь выполнить встраивание, используя AJAX для вызова кода встраивания, потому что у меня много каналов и я не хочу использовать PHP echo

Я использую этот код

embedios="<video x-webkit-airplay=\"allow\"> ";
embedios=embedios+"<source src=\""+stream+"\" type=\"video/mp4\"> ";
embedios=embedios+"<!-- other sources and fallbacks go here --></video> ";
embed=embedios;

и проблема в том, что вывод получается вот так

<video x-webkit-airplay="allow" tabindex="0">
<source type="video/mp4" src="http://yoursn0w.com/ch3.m3u8 "></source>
<!-- other sources and fallbacks go here -->
</video>

но вместо этого я хочу, чтобы это вышло вот так

<video x-webkit-airplay="allow"> 
  <source src="http://yoursn0w.com/ch3.m3u8" type="video/mp4"> 
  <!-- other sources and fallbacks go here --> 
</video>

Я не знаю, что я сделал не так в этом коде

Ответы [ 2 ]

1 голос
/ 01 сентября 2011

Вы не заканчиваете свои строки:

embedios="<video x-webkit-airplay=\"allow\">"
embedios=embedios+"<source src=\""+stream+"\" type=\"video/mp4\">"
embedios=embedios+"<!-- other sources and fallbacks go here --></video>"
embed=embedios;
1 голос
/ 01 сентября 2011

Ваши котировки не соответствуют должным образом.

var embedios='<video x-webkit-airplay=\"allow\">'
embedios=embedios+'<source src=\""+stream+"\" type=\"video/mp4\">'
embedios=embedios+'<!-- other sources and fallbacks go here --></video>'
embed=embedios;
...