What you wish to do could be possible by using an iframe.
It could originally point to a blank file so it wont have to load the ping. Then javascript can be used to change the address of the iframe
Code:
<script type="text/javascript">
function Reload(address) {
var f = document.getElementById("iframe1");
f.src = address;
}
</script>
Just call that function when u want to ping. e.g.
Code:
<input type="button" onClick="Reload('ping.php?ip=100.100.100.100');">
You could also make this iframe invisible when not used...
Code:
<div id="div1" style="display: none;">
<iframe goes here>
</div>
And toggle visibility with:
Code:
<script language="javascript">
<!--
var state = 'none';
function showhide(layer_ref) {
if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
//-->
</script>
<a href="javascript:showhide('div1');">Show/hide</a>
Hope this helps!
Nick
Bookmarks