Re: Javascript newbie - Please Help
- From: stefanoelle <onde@xxxxxxxxxxxx>
- Date: Sun, 30 Dec 2007 20:11:49 +0100
If you do not know why you are using:
1. type="text/javascript"
2. // <![CDATA[
3. // ]]>
...then it is a good indication you should not be using them.
First of all thank you to everybody for the answers received.
As previously specified I don't know javascript, so I don't understand the meaning of <![CDATA[ ......
Any way, seems it is the only way to solve my problem, so I tried the following, just for testing:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>IP TEST</title>
</head>
<BODY>
</body>
<script type="text/javascript">
alert("Ready to go !!!");
// <![CDATA[
<?php
// User's IP address
print 'var ip1 = ' . $_SERVER['REMOTE_ADDR'] . ';';
// Resolve the IP for the current host
print 'var ip2 = ' . gethostbyname('www.yahoo.com') . ';';
?>
alert("IP Address is "+ip1);
// ]]>
</script>
</html>
But I can't get the alert message with ip1. What is wrong ?
Please note: my browser is Firefox under Linux.
Thank you again.
Stefano
.
- Follow-Ups:
- Re: Javascript newbie - Please Help
- From: Thomas 'PointedEars' Lahn
- Re: Javascript newbie - Please Help
- References:
- Javascript newbie - Please Help
- From: StefanoElle
- Re: Javascript newbie - Please Help
- From: Evertjan.
- Re: Javascript newbie - Please Help
- From: StefanoElle
- Re: Javascript newbie - Please Help
- From: -Lost
- Javascript newbie - Please Help
- Prev by Date: Re: How to modify on_mouse_move function
- Next by Date: Re: Adding custom events to widget
- Previous by thread: Re: Javascript newbie - Please Help
- Next by thread: Re: Javascript newbie - Please Help
- Index(es):
Relevant Pages
|