RSS

Daily Archives: March 4, 2013

Tip of the day

Display: None | Block

// block –> Display the layer
function showLayer(layerName)
{
if (document.getElementById) // Netscape 6 and IE 5+
{
var targetElement = document.getElementById(layerName);
targetElement.style.display = ‘block’;
}
}

// none –> hide the layer
function hideLayer(layerName)
{
if (document.getElementById){
var targetElement = document.getElementById(layerName);
targetElement.style.display = ‘none’;
}
}

Useful site : http://www.brainjar.com/

Happy Coding!.

Get glued to know more updates.

Have a nice day:-)

 
Leave a comment

Posted by on March 4, 2013 in Uncategorized

 

Split the string in to array and tune for prefix – Javascript

Hi folks,

This post is continuation of my previous post. This post is same as the precious post but this will helps to split the given string in to an array object and search for the prefix from each word using Javascript.

Below is the working code.

<html>
<script >
window.onload = function() {
var icName = “ICName icJava”;
var icNameList = icName.split(” “);
for(var i =0; i < icNameList.length;i++){
var spiltICName = icNameList[i];
if(icNameList[i].substring(0,2) == ‘IC’){
alert(‘2 items found’);
}
}
}
</script>
<body>
</body>
</html>

Hope this will save your time for some extent.

Happy Coding!.

Get glued to know more updates.

Have a nice day 🙂

 
Leave a comment

Posted by on March 4, 2013 in Uncategorized

 

Split the given String in to Array and tune for prefix – Java

Hi folks,

This post is for to split the given string in to an array object and search for the prefix from each word using java.

Here is the working code to reduce your time.

public class StringSearchDemo {
/**
* @param args
*/
public static void main(String[] args) {
String icName = “Search Java ICName”;
boolean b = validateICCheck(icName);
System.out.println(b);
}

public static boolean validateICCheck(String icName) {
String[] icNameList = icName.split(“\\s”);
boolean index = false;
for (int i = 0; i < icNameList.length; i++) {
if(icNameList[i].startsWith(“IC”)){
index = icNameList[i].startsWith(“IC”);
return index;
}
}
return index;
}
}

Hope this will save you development for some extent.

Get glued to know more updates.

Have a nice day:-)

 
Leave a comment

Posted by on March 4, 2013 in Uncategorized