0

hi experts,

Here i have a problem with innerHTML in php page.

<script type="text/javascript"> 
function GetInner(sid)
{
document.getElementById("sid").innerHTML='<?php $id='+sid+'?>';
}
}
</script>

<body> 
<p id="sid">&nbsp;</p>
</body>

it doesn't give any result.

Please help me.

Edited by nav33n: Use [code] tags for easy readability.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Narayan15
0

That's because Javascript is client side, while PHP is server side. What exactly are you trying to do here?

0

THis is my code:

<html> <head> 
<style type="text/css"> 
.popup { border: solid 3px #008040; font-family: Tahoma; font-size: 12px; display: none; position: absolute; width: 650px;z-index: 60; } 
.popuptitle { background: #FFFFBB; color: #800000; font-weight: bold; height: 15px; padding: 5px;text-align: right; } 
.popupbody { background: #FFFFBB; padding: 5px; height:300px; text-align: center; } 
#popup1 { top: 200px; left: 300px; } </style> 
<script type="text/javascript"> 
function popupWindow(o,d,sid)
{
var obj = document.getElementById(o); 
if(d)
{
var stid = '$id='+sid;
alert(stid);
document.getElementById("sid").innerHTML=
obj.style.display = 'block'; 
}
else 
{
obj.style.display = 'none';
}
}
</script> 
</head> 
<body> 
<p id="sid">&nbsp;</p>
<a href="javascript: popupWindow('popup1',true,'');">N081234</a> 
<br>
<a href="javascript: popupWindow('popup1',true,'N081234');">N081235</a> 

<div id="popup1" class="popup"> 
<div class="popuptitle"><font style="font-size:20px" color="#8B0000"><a href="javascript: popupWindow('popup1',false,'N');">X</a></font></div>
<div class="popupbody"> 
<? 
$path = "incl.php";
include($path); 
?>
</div> 
</div> 
</body> </html>

When i click on ID, i need to get details of particular ID

Edited by nav33n: Use [code] tags to wrap your code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.