Click here to Skip to main content
12,697,620 members (26,191 online)

Web Development

QuestionDialog auto-resize Pin
awedaonline27-Sep-12 9:25
memberawedaonline27-Sep-12 9:25 
AnswerRe: Dialog auto-resize Pin
VijayChauhan1237-Oct-12 22:01
memberVijayChauhan1237-Oct-12 22:01 
GeneralRe: Dialog auto-resize Pin
awedaonline12-Oct-12 2:12
memberawedaonline12-Oct-12 2:12 
QuestionMultilingual webpage Pin
Akash Patel25-Sep-12 7:27
memberAkash Patel25-Sep-12 7:27 
AnswerRe: Multilingual webpage Pin
Andrei Straut25-Sep-12 7:58
memberAndrei Straut25-Sep-12 7:58 
AnswerRe: Multilingual webpage Pin
Mighty Raju27-Sep-12 3:55
memberMighty Raju27-Sep-12 3:55 
QuestionModifying accept header with IE9 and above Pin
Rajesh R Subramanian25-Sep-12 1:41
memberRajesh R Subramanian25-Sep-12 1:41 
Questionvariable element id Pin
safa223-Sep-12 21:29
membersafa223-Sep-12 21:29 
i'm newbie in ajax,php .i'm doing the following
1. connect to sql get hospitals name and display it
$con = mysql_connect("localhost","root","");
if (!$con)
  die('Could not connect: ' . mysql_error());
    mysql_select_db("trial", $con);
    $q=mysql_query("select g_name from  govermental_hos");

no problem with that.

2. display as dl
echo "<dl>";
    echo "<dt onclick=\"ajaxFunction()"\">";
    echo $row['g_name']."</dt>";


no problem with it
3. i want to give each id (would be variable)
then i wonna make onclick event so php will get info about the name clicked
function hos_info($g_name)
$query= mysql_query("select g_address,g_tel ,g_description from govermental_hos where g_name like '".$g_name."'");
{ $address=$row['g_address'];
echo $address;

the problem is can i access the clicked item via the java script

the script is
function ajaxFunction(){
    var ajaxRequest;  // The variable that makes Ajax possible!

        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        // Internet Explorer Browsers
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
        // Get the data from the server's response
    var g =  "<?php echo $row['g_name']; ?>";"GET", "gov_fetch_data.php" + g, true);

AnswerRe: variable element id Pin
Andrei Straut24-Sep-12 21:25
memberAndrei Straut24-Sep-12 21:25 
GeneralRe: variable element id Pin
safa226-Sep-12 5:35
membersafa226-Sep-12 5:35 
GeneralRe: variable element id Pin
Andrei Straut26-Sep-12 7:12
memberAndrei Straut26-Sep-12 7:12 
AnswerRe: variable element id Pin
Sebastiaan Meijerink30-Oct-12 5:08
memberSebastiaan Meijerink30-Oct-12 5:08 
QuestionGet webcam capture Pin
Killzone DeathMan21-Sep-12 2:16
memberKillzone DeathMan21-Sep-12 2:16 
AnswerRe: Get webcam capture Pin
Joan Murt22-Sep-12 2:31
memberJoan Murt22-Sep-12 2:31 
GeneralRe: Get webcam capture Pin
Killzone DeathMan22-Sep-12 12:10
memberKillzone DeathMan22-Sep-12 12:10 
AnswerMessage Automatically Removed Pin
19-Oct-12 23:00
membersarlishah19-Oct-12 23:00 
QuestionHUGE Web Service Performance Issue Pin
Jammer21-Sep-12 1:53
memberJammer21-Sep-12 1:53 
AnswerRe: HUGE Web Service Performance Issue Pin
jkirkerx21-Sep-12 12:04
memberjkirkerx21-Sep-12 12:04 
GeneralRe: HUGE Web Service Performance Issue Pin
Mohibur Rashid22-Sep-12 4:00
memberMohibur Rashid22-Sep-12 4:00 
GeneralRe: HUGE Web Service Performance Issue Pin
jkirkerx22-Sep-12 9:35
memberjkirkerx22-Sep-12 9:35 
GeneralRe: HUGE Web Service Performance Issue Pin
manak chand22-Oct-12 1:24
membermanak chand22-Oct-12 1:24 
SuggestionStore the history of links the user visits of any browser Pin
VijayChauhan12319-Sep-12 19:21
memberVijayChauhan12319-Sep-12 19:21 
GeneralRe: Store the history of links the user visits of any browser Pin
Andrei Straut19-Sep-12 22:09
memberAndrei Straut19-Sep-12 22:09 
GeneralRe: Store the history of links the user visits of any browser Pin
S.M. Zamshed Farhan12-Jan-13 16:31
memberS.M. Zamshed Farhan12-Jan-13 16:31 
Questionsocket read on a keep alive request waits until connection timeout Pin
Jayapal Chandran17-Sep-12 5:50
memberJayapal Chandran17-Sep-12 5:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 20 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid