<?
//"ip.php" example- display user IP address on any page
Header("content-type: application/x-javascript");
$serverIP=$_SERVER['REMOTE_ADDR'];
echo "document.write(\"Your IP address is: <b>" . $serverIP . "</b>\")";
echo"alert("\hello\")";
?>And once called by external JavaScript:
<script type="text/javascript" src="ip.php"></script>
the code echo"alert("\hello\")";
is not executing please give a solution
external javascript
Moderator: General Moderators
Re: external javascript
You're mixing up types: application/x-javascript and text/javascript. Pick one MIME type and stick with it.
To be specific, use the latter.
To be specific, use the latter.