Why is it the value of the first time that is taken?

Source: Internet
Author: User
Why is the value of the first time taken?
while ($row =mysql_fetch_array ($query))
{
?>





(note: Up to four words!) )




}
?>



function check (ID)
{
var Tit=document.getelementbyid (' title '). Value;
alert (tit);
S_xmlhttprequest ();//Introduce the above object in order to use the above method.
Xmlhttp.open ("GET", "changelink.php?title=" +tit+ "&id=" +id,true); Xmlhttprequest.open (delivery method, address, whether asynchronous request)
xmlhttp.onreadystatechange=byphp; Ready to execute, call the following method
Xmlhttp.send (null);//Send
}
function Check1 (ID)
{
var Lin=document.getelementbyid (' link '). value;
S_xmlhttprequest ();//Introduce the above object in order to use the above method.
Xmlhttp.open ("GET", "changelink.php?link=" +lin+ "&id=" +id,true); Xmlhttprequest.open (delivery method, address, whether asynchronous request)
xmlhttp.onreadystatechange=byphp; Ready to execute, call the following method
Xmlhttp.send (null);//Send
}


Why every time I take is the first time that the ID of the change, I each row of the ID are different, should be taken to the corresponding value of the different IDs to Ah, get a half-day, or do not know what to do, seek expert guidance, thank you!
------Solution--------------------
The ID of the title of your loop output is the same, you can only take the first one.



function check (ID)
{
var Tit=document.getelementbyid (' title ' +id). Value;
alert (tit);
...............

The following link is also true
------Solution--------------------
Reference:
the ID of the title of your loop output is the same, you can only take the first 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.