String variable returned object in Javascript -


i have problem variable string return [object object]

$(document).ready(function () {     $(".story-area > h1").text(function () {         return $(this).text(convertstring($(this).text()));     });      $(".story-area > p").text(function () {         return $(this).text(convertstring($(this).text()));     });      $(".story-area > div > p").text(function () {         return $(this).text(convertstring($(this).text()));     }); });   function convertstring(current_text) {     var arr_text = current_text.split(' ');     var new_text = '';     (i = 0; < arr_text.length; i++) {         if (arr_text[i].length > 4) {             new_text += arr_text[i].replace(/[hh][ii]/g, 'hiv') + ' ';         } else {             new_text += arr_text[i] + ' ';         }     }     return new_text; } 

the new_text value returns [object object] instead of string value. errors on code?

enter image description here

ah, setting text inside of setting text! treating text() each.

$(".story-area > h1").text(function () {     return convertstring($(this).text()); }); 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -