Apr 23
I just found a new way of calling a php file
You have heard about this
<script type=”text/javascript” src=”java2.js”>
</script>
The good thing is that you can also call a php file using this SRC attribute javascript just replace “java2.js” with “java2.php” like this
<script type=”text/javascript” src=”java2.php”>
</script>
The good thing is you do n’t have to mess with the design of your site with the php code as you can just call by javascript and it can be also used on plain html pages.For example ,I have a free webhosting account for my site www.freewebspace.co.nr ,to know the ip address of the visitors to my site , I will simply call my php file ip1.php which resides on this site.
Something like this
<script type=”text/javascript” src=”http://www.ramanean.com/ip1.php”>
</script>
And the only one disadvantage you have is you can’t find the referer to your site by calling the php file you have to find it by javascript only ,if you intend to find referer toyour plain HTML page.
Feb 29
Here is a simple javascript for a prompt box
<html>
<head>
<script type=”text/javascript”>
function disp()
{
var name=prompt(”Please enter your name”);
if (name==”ramanean”&&name=”Ramanean”)
{
document.write(”Hello ” + name + “Are you fine?”);
}
}
</script>
</head>
<body>
<input type=”button” onclick=”disp” value=”Display a prompt box” />
</body>
</html>
The above code will display a prompt box “Hello Ramanean Are you fine?” when display prompt box is clicked
Feb 26
here is a simple javascript for an alert box
<script type=”text/javascript”>
alert(”My name is ramanean”);
</script>
When the above javascript is executed , a alert box will appear with the text “My name is Ramanean”
<script type=”text/javascript”>
alert(”My name is ramanean,My blog is www.ramanean.com,It has useful resources”);
</script>
When the above javascript is executed , a alert box will appear with the text “My name is ramanean,My blog is www.ramanean.com,It has useful resources” on a same line
Here you can you use line breaks(\n) to move the text to a new line
Below there is a simple example of javascript using line breaks
<script type=”text/javascript”>
alert(”My name is ramanean”+’\n\n’+My blog is www.ramanean.com,+’\n\n’+It has useful resources”);
</script>
Now the text will appear in 3 different lines,when the script is executed
Feb 25
here is a simple javascript that can be used for redirecting a user to a fresh page or another web page
<script type=”text/javascript”>
window.location=”http://www.livepr.info/internal-pages-page-rank3.php”;
</script>
When this script is executed the page will be redirected to http://www.livepr.info/internal-pages-rank3.php
Most webmasters user javascript for redirection as it works on all kind of browsers
Feb 23
Here is a simple Javascript
<script type=”text/javascript”> document.write(”Hello World!”); </script>
Output:
Hello world
Also you can test this in your browser also
Just Copy this code and paste it in your browser
javascript: document.write(”Hello World!”);
Paste this in your address bar