I want to open a popup window which fetch country name from table and after click on the country name into the popup window the country name should transfer to parent window textbox. Please help me
I don't get exactly what exactly you want, but it should be something like this: <html> <head> <script type="text/javascript"> function openlol(id) { myWindow = window.open ("","mywindow","width=500,height=500"); // the command you use to open new window var cols = document.getElementsByTagName("td"); var country = cols[id].innerHTML; myWindow.document.write(country); myWindow.focus( ); } </script> </head> <body> <table border="1" id="country"> <tr> <td onclick="openlol(0);">Canada</td> </tr> <tr> <td onclick="openlol(1);">USA</td> </tr> </table> </body> </html> HTML: There's no need for ajax for something as simple as this.
He might have to use Ajax, otherwise why would he have to transfer the country name to a new window then back... You might have to use Ajax and open a new page you've created containing another JavaScript. The open it. Use the new page to connect with the parent page. To fetch from a MySQL table you'll need to use Ajax.
I don't think that's possible with ajax alone, he'll have to use server-side language like PHP to fetch mysql tables. Plus, his question is ambiguous. I don't know if he meant html table or mysql table.. If you read my example, it's html table.
Sorry for my bad explanation. Thanks for your replies the problem is solved. I wanted to fetch data from Mysql table to my pop up window. Now another problem is how to prevent the pop up window to get minimized when user click on the parent window it should be closed not minimize.