10/10/2018, 00:14
Dịch đoạn code javascript sang HTML thế nào để đọc cho sướng
Mình có đoạn code âm nhạc sau ( lây từ 1 trang web âm nhạc )
<script>
document.write(unescape("%3COBJECT%20ID%3D%22Playe r%22%20classid%3D%22CLSID%3A6BF52A52-394A-11d3-B153-00C04F79FAA6%22%20height%3D%22280%22%20width%3D%22 300%22%3E%0D%0A%3Cparam%20name%3D%22url%22%20value %3D%22http%3A%2F%2F123.30.108.17%2Fmedia%2Fmusic.p hp%3Fact%3Dasx&sm%3D52cc9ce95b8b740ae792a0a4e1b373 e4&time%3D1215347318&uid%3D0%22%3E%0D%0A%3CPARAM%2 0NAME%3D%22ShowControls%22%20VALUE%3D%221%22%3E%0D %0A%3Cparam%20name%3D%22playCount%22%20value%3D%22 999%22%3E%0D%0A%3Cparam%20name%3D%22Volume%22%20va lue%3D%22100%22%3E%0D%0A%3Cparam%20name%3D%22Enabl eContextMenu%22%20value%3D%220%22%3E%0D%0A%3Cembed %20type%3D%22application%2Fx-mplayer2%22%20pluginspage%3D%22http%3A%2F%2Fwww.mi crosoft.com%2FWindows%2FMediaPlayer/%22%20src%3D%22http%3A%2F%2F123.30.108.17%2Fmedia% 2Fmusic.php%3Fact%3Dasx&sm%3D52cc9ce95b8b740ae792a 0a4e1b373e4&time%3D1215347318&uid%3D0%22%20name%3D %22PlayerEx2%22%20width%3D300%20height%3D280%20aut ostart%3D1%20showcontrols%3D1%20volume%3D100%20Ena bleContextMenu%3D0%3E%3C/embed%3E%0D%0A%3C/OBJECT%3E%3Cbr%3E"));
</script>
Cho mình hỏi có cách nào để đoạn code trên dễ đọc hơn kô. Mình bị rắc rối bởi mấy kí tự % đó.
Thanks
<script>
document.write(unescape("%3COBJECT%20ID%3D%22Playe r%22%20classid%3D%22CLSID%3A6BF52A52-394A-11d3-B153-00C04F79FAA6%22%20height%3D%22280%22%20width%3D%22 300%22%3E%0D%0A%3Cparam%20name%3D%22url%22%20value %3D%22http%3A%2F%2F123.30.108.17%2Fmedia%2Fmusic.p hp%3Fact%3Dasx&sm%3D52cc9ce95b8b740ae792a0a4e1b373 e4&time%3D1215347318&uid%3D0%22%3E%0D%0A%3CPARAM%2 0NAME%3D%22ShowControls%22%20VALUE%3D%221%22%3E%0D %0A%3Cparam%20name%3D%22playCount%22%20value%3D%22 999%22%3E%0D%0A%3Cparam%20name%3D%22Volume%22%20va lue%3D%22100%22%3E%0D%0A%3Cparam%20name%3D%22Enabl eContextMenu%22%20value%3D%220%22%3E%0D%0A%3Cembed %20type%3D%22application%2Fx-mplayer2%22%20pluginspage%3D%22http%3A%2F%2Fwww.mi crosoft.com%2FWindows%2FMediaPlayer/%22%20src%3D%22http%3A%2F%2F123.30.108.17%2Fmedia% 2Fmusic.php%3Fact%3Dasx&sm%3D52cc9ce95b8b740ae792a 0a4e1b373e4&time%3D1215347318&uid%3D0%22%20name%3D %22PlayerEx2%22%20width%3D300%20height%3D280%20aut ostart%3D1%20showcontrols%3D1%20volume%3D100%20Ena bleContextMenu%3D0%3E%3C/embed%3E%0D%0A%3C/OBJECT%3E%3Cbr%3E"));
</script>
Cho mình hỏi có cách nào để đoạn code trên dễ đọc hơn kô. Mình bị rắc rối bởi mấy kí tự % đó.
Thanks
Bài liên quan
<OBJECT ID="Playe r" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" height="280" width=" 300">
<param name="url" value ="http://123.30.108.17/media/music.p hp?act=asx&sm=52cc9ce95b8b740ae792a0a4e1b373 e4&time=1215347318&uid=0">
<PARAM%2 0NAME="ShowControls" VALUE="1">
<param name="playCount" value=" 999">
<param name="Volume" va lue="100">
<param name="Enabl eContextMenu" value="0">
<embed type="application/x-mplayer2" pluginspage="http://www.mi crosoft.com/Windows/MediaPlayer/" src="http://123.30.108.17/media% 2Fmusic.php?act=asx&sm=52cc9ce95b8b740ae792a 0a4e1b373e4&time=1215347318&uid=0" name= "PlayerEx2" width=300 height=280 aut ostart=1 showcontrols=1 volume=100 Ena bleContextMenu=0></embed>
</OBJECT>
Nhìn qua thì thấy nó sử dụng unescape, nên tớ đoán chuỗi gốc đã mã hóa bằng escape và khi write thì gọi unescape dịch ngược đấy mà.
Làm biếng thử quá
http://www.google.com.vn/search?hl=v...i+Google&meta=
Bên IE thì đang xài Instant Source, tuy nhiên cái này mất tiền
http://www.google.com.vn/search?hl=v...1%BA%BFm&meta=
Thân mến.