The younger brother encountered a problem. please help me.

Source: Internet
Author: User
The younger brother encountered a problem. please help me.



$ Rs = mysql_query ("select * from title ");
$ Row = mysql_fetch_array ($ rs );
$ Num = mysql_num_rows ($ rs );
// Echo $ num;
For ($ I = 1; $ I <= 8; $ I ++)
{
$ Rs = mysql_query ("select * from title where parent_id = $ I ");
$ Row = mysql_fetch_array ($ rs );
// Print_r ($ row)
?>

"Width =" 160px ">


$ SQL = "select * from index_kind where parent_id = $ I ";
$ Rs = mysql_query ($ SQL );

While ($ row = mysql_fetch_array ($ rs ))
{

?>
') "OnMouseOut =" omout (this) "id =" ">



}
?>













(This is ajax processing)

Require_once 'Conn. php ';
$ Child_id = $ _ GET ["id"];
$ Rs = mysql_query ("select * from index_kind where child_id = '$ child_id '");
$ Row = mysql_fetch_array ($ rs );
$ Nums = mysql_num_rows ($ rs );
For ($ I = 1; $ I <= $ nums; $ I ++)
{
Echo $ row ["good_img"];
}
?>


(Here is AJAX)
Function omo (obj, str)
{
// Alert (str );
Obj. style. borderBottom = "1px solid # e4393c ";
// Alert (obj. id );
Var xmlhttp;
If (window. XMLHttpRequest)
{
Xmlhttp = new XMLHttpRequest ();
}
Else
{
Xmlhttp = new ActiveXObject ("Microsoft. XMLHttp ");
}
Xmlhttp. open ("get", "chuli. php? Id = "+ obj. id, true );
Xmlhttp. onreadystatechange = function (){
// Alert (xmlhttp. readyState)
If (xmlhttp. readyState = 4)
{
Alert (xmlhttp. responseText)

Document. getElementById (str). innerHTML = "";

}
}
Xmlhttp. send (null );
}

This is the database I used for testing.



Then, when I move to this redline, the image address is displayed.




I want the image to be displayed in the black box below, but it cannot be obtained !!! Please help me solve the problem !!!


Reply to discussion (solution)

Since you document. getElementById (str). innerHTML = "";
Therefore, xmlhttp. responseText should be a valid image path.
Alert (xmlhttp. responseText) can see multiple images. The image names are regarded as the path of an image and will not be displayed in any way.

I know that because $ row [good_img] is an array, I just don't know how to display the paths in this array one by one as an image.

After the server side json is uploaded back, use the js eval to split the file one by one.

Find out how to split the code one by one

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.