[Hỏi đáp] Tạo javaScript play link trực tiêp mp3 Zing

  Bài viết hay nhất1
Mình muốn tạo một JS chuyển đổi từ dạng link trực tiếp này

http://mp3.zing.vn/bai-hat/Lanh-Tron-Dem-Mua-Nhu-Quynh/ZWZ96OZF.html

thành

Code:
<iframe width="300" height="84" src="http://mp3.zing.vn/embed/song/ZWZ96OZF?autostart=false" frameborder="0" allowfullscreen="true"></iframe>

Bac nào biêt xin hãy jup đỡ. Cảm ơn!
  Bài viết hay nhất2
-tạo 1 js để ở in the topic
-Để code sau vào:
Code:
var link, id;
$("a").each(function() {
    link = $(".post-contents").find($(this)).text();
    if (link.slice(0, 27) === "http://mp3.zing.vn/bai-hat/" || link.slice(0, 25) === "http://mp3.zing.vn/album/") {
        id = link.slice(-13, -5);
        if(link.slice(0, 27) === "http://mp3.zing.vn/bai-hat/")
            $(this).after("<br/><iframe width=\"600\" height=\"168\" src=\"http://mp3.zing.vn/embed/song/" + id + "?autostart=false\" frameborder=\"0\" allowfullscreen=\"true\"></iframe>");
        else
            $(this).after("<br/><iframe width=\"600\" height=\"168\" src=\"http://mp3.zing.vn/embed/album/" + id + "?autostart=false\" frameborder=\"0\" allowfullscreen=\"true\"></iframe>");
    }
});
  Bài viết hay nhất3
Có thiếu sot gì không sêp? Không có hiệu lực
  Bài viết hay nhất4
xin cái demo onl đi thớt
  Bài viết hay nhất5
http://learn.forumvi.com/t931-test-zing-player-again

[Hỏi đáp] Tạo javaScript play link trực tiêp mp3 Zing Zing_p10
  Bài viết hay nhất6
dòng 3 thay .post-contents thành .post-entry
  Bài viết hay nhất7
Code:

$(function() {
var link, id;
$("a").each(function() {
    link = $(".pun .entry-content").find($(this)).text();
    if (link.slice(0, 27) === "http://mp3.zing.vn/bai-hat/" || link.slice(0, 25) === "http://mp3.zing.vn/album/") {
        id = link.slice(-13, -5);
        if(link.slice(0, 27) === "http://mp3.zing.vn/bai-hat/")
            $(this).replaceWith("<br/><iframe width=\"600\" height=\"168\" src=\"http://mp3.zing.vn/embed/song/" + id + "?autostart=false\" frameborder=\"0\" allowfullscreen=\"true\"></iframe>");
        else
            $(this).replaceWith("<br/><iframe width=\"600\" height=\"168\" src=\"http://mp3.zing.vn/embed/album/" + id + "?autostart=false\" frameborder=\"0\" allowfullscreen=\"true\"></iframe>");
    }
});
});
  Bài viết hay nhất8
Vẫn không được, mấy sếp ơi.
  Bài viết hay nhất9
mình đã bảo thay .post-contents thành .post-entry mà, mình test tren console thấy ok nhé
Code:

$(function() {
var link, id;
$("a").each(function() {
    link = $(".post-entry").find($(this)).text();
    if (link.slice(0, 27) === "http://mp3.zing.vn/bai-hat/" || link.slice(0, 25) === "http://mp3.zing.vn/album/") {
        id = link.slice(-13, -5);
        if(link.slice(0, 27) === "http://mp3.zing.vn/bai-hat/")
            $(this).replaceWith("<br/><iframe width=\"600\" height=\"168\" src=\"http://mp3.zing.vn/embed/song/" + id + "?autostart=false\" frameborder=\"0\" allowfullscreen=\"true\"></iframe>");
        else
            $(this).replaceWith("<br/><iframe width=\"600\" height=\"168\" src=\"http://mp3.zing.vn/embed/album/" + id + "?autostart=false\" frameborder=\"0\" allowfullscreen=\"true\"></iframe>");
    }
});
});
  Bài viết hay nhất10
Lạ nhỉ mình add js vào thì OK chạy ngon, lúc thoát ra thì code ko chạy
  Bài viết hay nhất11
Mình đã thử js của anhoang_qn và sonlapro đều chạy ngon.
  Bài viết hay nhất12
http://4rdinhcao.forumvi.com/t599-that-bat-ngo-truc-nhan

Thì ra ẩn link với khách trong đó có cả youtube nữa
  Bài viết hay nhất13
hmmmm chèn vào viewbody sau đó nhúng links trực tiếp nhé
Code:
<script>$('.post a[href*="mp3.zing.vn"]').each(function(){var a = $(this).attr('href');$(this).replaceWith('<iframe src="'+a+'" width="480" height="320"></iframe>')})</script>
  Bài viết hay nhất14

anhsairoi wrote:hmmmm chèn vào viewbody sau đó nhúng links trực tiếp nhé
Code:
<script>$('.post a[href*="mp3.zing.vn"]').each(function(){var a = $(this).attr('href');$(this).replaceWith('<iframe src="'+a+'" width="480" height="320"></iframe>')})</script>

Nó tải nguyên trang luôn bác ơi [Hỏi đáp] Tạo javaScript play link trực tiêp mp3 Zing Troll-63
  Bài viết hay nhất15
You cannot reply to topics in this forum