...

View Full Version : split replace '



BubikolRamios
12-15-2009, 12:37 PM
dropDownPart.innerHTML = tmpInnerHTML;


how does this tmpInnerHTML gets filled :



for (var i = 0; i < arr.length ; i++)
{
var arr1 = arr[i].split('|');
id_tezaver = arr1[0];
term = arr1[1]
// if arr1[1] contains ', then ewerything after that disapears inside term,
// like "bird's eyes" becomes "bird"
// how to handle that ?

// bad example how I get to verify that the stuff is complete inside array
// term = arr1[1].replace(/'/i, /oo/);

}

gusblake
12-15-2009, 02:25 PM
if(arr1[1].indexOf("'")!=-1) term=arr1[1].substring(0,arr1[1].indexOf("'"));
else term=arr1[1];

Kor
12-15-2009, 03:37 PM
innerHTML is not a standard DOM method. It will not always read/insert the elements or their attributes from/to the DOM tree. Take care of.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum