2011-11-01 53 views
0

我有js toolip的問題。我使用http://ara-abcarians.com/jquery/atooltip/的罰款。正在從MySQL數據庫加載文本。js toolip垃圾

echo "<td nowrap='nowrap'> <a href=\"#\" class=\"clickTip exampleTip\" "; 
echo "title1=\" ".$row['text']." \" "; 
echo "> aaaaa </a></td>"; 

從dBase中文本是一個格式化圖像

<img style="float: left;" src="./public/repository/images/2n0lcud.gif" alt="" width="350" height="76" /> 

和結束可視化崩潰。

2011-10-28 00:05:15 3 
2011-10-29 23:54:15 4 
2011-10-30 11:43:01 żźćńąśłęó ŻŹĆŃĄŚŁĘÓ "> 5 
2011-10-31 01:26:05 a1 
2011-10-31 01:26:33 a2 


2011-10-30 11:43:01 żźćńąśłęó ŻŹĆŃĄŚŁĘÓ "> 5 

其中

żźćńąśłęó ŻŹĆŃĄŚŁĘÓ - a piece of main text of the news - not to show (at this moment) 
"> - element of the html/php code - of course not to show 
5 - title of the news - only this can be show 

我改變的代碼:

echo "title1=' ".$row['text']." ' "; 

,並在老一點的

2011-10-28 00:05:15 3 
2011-10-29 23:54:15 4 
2011-10-30 11:43:01 5 
2011-10-31 01:26:05 a1 
2011-10-31 01:26:33 a2 

沒有崩潰的可視化,但崩潰現在正處於一個新的點

2011-10-28 00:05:15 '>3 
2011-10-29 23:54:15 4 
2011-10-30 11:43:01 5 
2011-10-31 01:26:05 a1 
2011-10-31 01:26:33 a2 
在正文中(從標題3)

xxxx'fffff 999999/666666 

當我嘗試顯示(的消息)的文字我只看到

xxxx 

(文通過tiny_mce和代碼加載到dbase)

addslashes($text) 

也許任何暗示stion如何解決它? brg

回答

0

使用htmlspecialcharsENT_QUOTES選項,addslashes應該用於轉義輸入不輸出!