[Hỏi đáp] Lỗi javascript

  Bài viết hay nhất1
Tình hình là mình có kiếm đc 1 widget dùng cho việc đọc văn bản tiếng Việt. Khi add vào forum thì nó bị lỗi khung chọn jọng đọc (voiceselection).
Nhờ các bác chỉnh lại jup với. Chân thành cảm ơn!

Code:
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>

<textarea id="text" cols="45" rows="3">Hello world</textarea>

<select id="voiceselection"></select>

<input
  onclick="responsiveVoice.speak($('#text').val(),$('#voiceselection').val());"
  type="button"
  value="Play"
/>

<script>
        //Populate voice selection dropdown
        var voicelist = responsiveVoice.getVoices();
        var vselect = $("#voiceselection");
        $.each(voicelist, function() {
                vselect.append($("<option />").val(this.name).text(this.name));
        });
</script>

Nguồn: http://responsivevoice.org/text-to-speech-sdk/text-to-speech-widget/
  Bài viết hay nhất2

congdantoancau wrote:Tình hình là mình có kiếm đc 1 widget dùng cho việc đọc văn bản tiếng Việt. Khi add vào forum thì nó bị lỗi khung chọn jọng đọc (voiceselection).
Nhờ các bác chỉnh lại jup với. Chân thành cảm ơn!

Code:
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>

<textarea id="text" cols="45" rows="3">Hello world</textarea>

<select id="voiceselection"></select>

<input
  onclick="responsiveVoice.speak($('#text').val(),$('#voiceselection').val());"
  type="button"
  value="Play"
/>

<script>
        //Populate voice selection dropdown
        var voicelist = responsiveVoice.getVoices();
        var vselect = $("#voiceselection");
        $.each(voicelist, function() {
                vselect.append($("<option />").val(this.name).text(this.name));
        });
</script>

Nguồn: http://responsivevoice.org/text-to-speech-sdk/text-to-speech-widget/

Bạn xem thử đã được chưa ^^!
Code:
  <script src="https://code.responsivevoice.org/responsivevoice.js"></script><script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <textarea rows="3" cols="45" id="helps_text">Hello world</textarea> <select id="voiceselection"></select>  <input value="Play" type="button" onclick="responsiveVoice.speak($('#helps_text').val(),$('#voiceselection').val());" /> <script>
        //Populate voice selection dropdown
        var voicelist = responsiveVoice.getVoices();
        var vselect = $("#voiceselection");
        $.each(voicelist, function() {
                vselect.append($("<option />").val(this.name).text(this.name));
        });
</script> <style type="text/css">textarea#helps_text {
    max-width: 140px;
}</style>
  Bài viết hay nhất3

nguyenhuynhhuyhoang wrote:Bạn xem thử đã được chưa ^^!
Chưa được bác ơi.
Bác thử trong forum rồi báo kết quả cho mình với!
  Bài viết hay nhất4

congdantoancau wrote:
nguyenhuynhhuyhoang wrote:Bạn xem thử đã được chưa ^^!
Chưa được bác ơi.
Bác thử trong forum rồi báo kết quả cho mình với!

Ý bạn là cái khung chọn ngôn ngữ nói ý hả @@! mình đọc không kỹ tưởng cái khung bị lỗi
  Bài viết hay nhất5
Mình add code vào vẫn bt mà bạn:
>> Tạo 1 trang html quăng đoạn code này vào:
Code:
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>

<textarea id="text" cols="45" rows="3">Hello world</textarea>

<select id="voiceselection"></select>

<input
  onclick="responsiveVoice.speak($('#text').val(),$('#voiceselection').val());"
  type="button"
  value="Play"
/>

<script>
        //Populate voice selection dropdown
        var voicelist = responsiveVoice.getVoices();
        var vselect = $("#voiceselection");
        $.each(voicelist, function() {
                vselect.append($("<option />").val(this.name).text(this.name));
        });
</script>

>>Nếu bạn muốn cho vào 1 bài viết thì tạo 1 topic mới (cho phép html hoạt động trong bài viết)
quăng đoạn này vào nội dung bài viết là được:
Code:
<center><iframe src="Link HTML" width="350px" height="100px"></iframe></center>
Còn nếu bạn muốn chèn vào widget thì cũng đoạn iframe đó và chỉnh sửa lại width của nó cho phù hợp là được
  Bài viết hay nhất6
Chưa thử nhưng đoán lỗi là do cái này http://responsivevoice.com/pricing/
  Bài viết hay nhất7

nguyenhuynhhuyhoang wrote:>>Nếu bạn muốn cho vào 1 bài viết thì tạo 1 topic mới (cho phép html hoạt động trong bài viết)
quăng đoạn này vào nội dung bài viết là được:
Code:
<center><iframe src="Link HTML" width="350px" height="100px"></iframe></center>
Còn nếu bạn muốn chèn vào widget thì cũng đoạn iframe đó và chỉnh sửa lại width của nó cho phù hợp là được
Cảm ơn bác!
Mình chèn nó vào widget cho trang portal thế là nó bị bóp lại cái khung select.
Ý tưởng khung iframe hay đấy! Chỉ có điều jờ nó lại xuất hiện 2 thanh cuộn xấu lắm.

[Hỏi đáp] Lỗi javascript Doc_va10

- Demo http://learn.forumvi.com/
- Widget source
Code:
<iframe style="width: 180px; height: 120px" src="http://learn.forumvi.com/h5-page"></iframe>

- Trang HTML
Code:
<script src="https://code.responsivevoice.org/responsivevoice.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>

<textarea id="text" cols="20" rows="3">Hello world</textarea>

<select id="voiceselection"></select>

<input
  onclick="responsiveVoice.speak($('#text').val(),$('#voiceselection').val());"
  type="button"
  value="Play"
/>

<script>
        //Populate voice selection dropdown
        var voicelist = responsiveVoice.getVoices();
        var vselect = $("#voiceselection");
        $.each(voicelist, function() {
                vselect.append($("<option />").val(this.name).text(this.name));
        });
</script>

Nhân tiện là có cach nào để jọng tiếng Việt là mặc định jống trang này không nhỉ?


Zzbaivong wrote:Chưa thử nhưng đoán lỗi là do cái này http://responsivevoice.com/pricing/
Cảm ơn bác. Free vẫn cho Multilanguagevoice mà
  Bài viết hay nhất8
congdantoancau wrote:Mình chèn nó vào widget cho trang portal thế là nó bị bóp lại cái khung select.
Ý tưởng khung iframe hay đấy! Chỉ có điều jờ nó lại xuất hiện 2 thanh cuộn xấu lắm.

Cái này bạn chỉ cần sửa lại width của iframe là được đây:
Code:
<iframe style="width: 230px; height: 120px" src="http://learn.forumvi.com/h5-page"></iframe>
congdantoancau wrote:

[left]Nhân tiện là có cach nào để jọng tiếng Việt là mặc định jống trang này không nhỉ?


Sửa lại trang html thay toàn bộ code cũ lại bằng code này là được

Code:
<script src="http://helps.forumvi.com/31436.js"></script><script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <textarea rows="3" cols="45" id="text">Hello world</textarea> <select id="voiceselection"></select>  <input value="Play" type="button" onclick="responsiveVoice.speak($('#text').val(),$('#voiceselection').val());" /> <script>
        //Populate voice selection dropdown
        var voicelist = responsiveVoice.getVoices();
        var vselect = $("#voiceselection");
        $.each(voicelist, function() {
                vselect.append($("<option />").val(this.name).text(this.name));
        });
</script>

Xong !! Chúc bạn thành công :D
  Bài viết hay nhất9

nguyenhuynhhuyhoang wrote:
congdantoancau wrote:Chỉ có điều jờ nó lại xuất hiện 2 thanh cuộn xấu lắm.

Cái này bạn chỉ cần sửa lại width của iframe là được đây:
Code:
<iframe style="width: 230px; height: 120px" src="http://learn.forumvi.com/h5-page"></iframe>

Cảm ơn bác. Vụ mặc định ngon rồi. Nhưng cái khung mà kéo dãn ra thế thì cả cái cấu trúc hệ thống khung bên fải trang cũng bị ảnh hưởng theo. Thôi chắc cho nó xuống đáy vậy.
  Bài viết hay nhất10
You cannot reply to topics in this forum