具体原因是缺少双引号" "
写法如下:
return "<span title=\""+productName+"\">"+productName+"</span>";
这样就会显示全部。而不会在空格处截断。