Archive for November, 2007|Monthly archive page
Simple Ajax with YUI!!!
For those of you, who want to get started with YUI and Ajax, this would surely prove helpful.
<html><head>
<title>Lets learn YUI</title>
</head>
<body>
<div id="mydiv">
Add some Text or Images if you want to replace dynamically</div>
<a href="Loading.html" onclick="return YUI();">My first AJAX</a>
<script src="build/yahoo/yahoo-min.js" type="text/javascript"></script>
<script src="build/event/event-min.js" type="text/javascript"></script>
<script src="build/connection/connection-min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function YUI(){
var loadUrl = "Loading.html";
var callback = {
success: function(o) {
document.getElementById('mydiv').innerHTML = o.responseText;
},
failure: function(o) {
alert("AJAX doesn't work"); //FAILURE
}
}
var transaction = YAHOO.util.Connect.asyncRequest('GET', loadUrl, callback, null);
return false;
}
//]]>
</script>
</body>
</html>
This is how one can simply make AJAX calls using YUI. The code is simple and self explanatory. If you need any help with this, please drop in comments.
Cheerz
Shri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book at Packt official site

http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
Quick Code for Rounded Corners using Rico!!!!
Quick Code is a new category in my blog, where I shall share the code with lil details
<script type="text/javascript" src="./scripts/prototype.js" language="JavaScript">
</script>
<script type="text/javascript" src="./scripts/rico.js" language="JavaScript">
</script>
<script type="text/javascript">
Rico.Corner.round('ID of ur DIV',{compact:false,blend:false,corners:'all'});
</script>
Code is self explanatory,you just need to pass the ID of the DIV u need make it Rounded Corner. Extra parameters you can pass are Color, etc which of course are optional
Cheerz
Shri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book {My Book} at Packt official site
http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
Breaking News!!!!
Read this piece of information Here
DesiMartini.com has been acquired by Hindustan Media’s Internet group
Cheerz to the team @ Desimartini
–Shri
Looking for serious Hackers!!!!!
Hello Readers,
I am seriously looking for some Hackers to work on some projects, if you are interested/ know of someone, please drop me a mail.
Looking for guys with
1. PHP
2. Flash
3. UI Designer
Not, necessary that they should work full time, can also work on weekends.
If any of the students are interested, I would be more than happy to work with you.
Drop me a mail at chshridharrao@gmail.com
Cheerz
Shri
Advanced Word Count for PHP!!!!!
If you have tried counting words in a string in PHP, you sure must have used “explode” function.
Its a pretty simple function and can be used in N-ways. A general simple function can be written as
$String = "This is my blog";
$words = explode(" ",String);
$num = count($words);
Now, this should give you the number of words (4) and following with the count of number of words{This, is, my, blog}.
BUT, the real problem is if your string is “Hello World”, the number of words here are 7 and count is also 7. How come? THats coz, of the fact the function explode takes delimiter as a space and will count the spaces, commas, etc also as words.
I have found a better way of doing the same. So here I am sharing with you.
Instead use this function, in which we check wheather the word is having any integer, charcter etc in it or not. If its a space we can royally ignore it
function wordCount($string){
$words = "";
$string = eregi_replace(" +", " ", $string);
$array = explode(" ", $string);
for($i=0;$i < count($array);$i++)
{
if (eregi("[0-9A-Za-zÀ-ÖØ-öø-ÿ]", $array[$i]))
$words[$i] = $array[$i];
}
return $words;
}
In this way, we can get the words as the user must have typed omitting the spaces and junk characters.
This function will return you a array of words in the string, and further we can even make it only Words++ to count how many words are there. So this function can actually work for 2 purposes.
1. Count the number of Words in a string
2. Get the words in array
Hope you find this useful.
CHeerz
Shri
If you are reading article, you might also be interested in the PHP and Scriptaculous Book I have authored.
The book gives you insights about effects, drag-n-drop, slideshows, applications, auto-completion, in-place editing and more. Complete code snippets and explanations.
CHECK out and BUY the PHP and Script.aculo.us book at Packt official site

http://www.packtpub.com/php-and-script-aculo-us-web-2-0-application-interface/book
Back to Blogging!!!
Been really busy with some personal and professional work, and now back to blogging after a long time.
So there has been lot of changes at my side, working on some “personal projects”, been to places, bought a bike etc etc.
now I shall keep the blog updating and jotting my learnings.
Cheerz
Shri
Comments (3)
Comments (1)
Leave a Comment
