export _JAVA_OPTIONS="-Xmx2g"
Sunday, October 16, 2011
Wednesday, October 12, 2011
Adding policy to a applet java
To Provide permissions to a applet first you need to write a Policy file.
Policy file can be created using a policytool .By this way a policy file can be created.
And to run the applet with the permissions added in the policyfile you need to run the applet in the following way:
appletviewer -J-Djava.security.policy=policy-file applet-file
Saturday, October 8, 2011
Making window.find method move to the start of the webpage firefox javascript
To make the window.find method move to the starting of the webpage incase when user clicked clear or he is trying to search for another word.
You need to select a word in the starting of the Page and using that word you need to perform window.find method which makes the cursor to move to the start of the webpage
For example in my case i select a word "linux" which lies in the first line of my webpage
You need to do like this:
sel.removeAllRanges(); // To remove any of the selections previously available in the webpage
found=window.find("linux,"false,false); // To select the word in the first line
sel=window.getSelection(); // To select the word to sel
range=sel.getRangeAt(0); // to add the selection to the range
if (sel.RangeCount > 0 ) sel.removeAllRanges(); // To remove the selection made by "linux" word
sel.addRange(range); // To add the selection to sel using addRange
This will do the trick moving to the first part of the webpage.
You need to select a word in the starting of the Page and using that word you need to perform window.find method which makes the cursor to move to the start of the webpage
For example in my case i select a word "linux" which lies in the first line of my webpage
You need to do like this:
sel.removeAllRanges(); // To remove any of the selections previously available in the webpage
found=window.find("linux,"false,false); // To select the word in the first line
sel=window.getSelection(); // To select the word to sel
range=sel.getRangeAt(0); // to add the selection to the range
if (sel.RangeCount > 0 ) sel.removeAllRanges(); // To remove the selection made by "linux" word
sel.addRange(range); // To add the selection to sel using addRange
This will do the trick moving to the first part of the webpage.
Thursday, October 6, 2011
For finding text in webpage javascript
In Internet Explorer
to copy the content of the webpage use
txt=document.body.CreateTextRange();
Now we need to search the desired string using findtext method
Assume string is the desired string to be searched
1)if txt.findtext(string)
{
2) txt.select() ; //will highlight the searched word
} For moving to the next string you have to bookmark the String
we need to move to the end we use
3) txt.collapse(false) ;
if we use true in this case it moves to the beginning
And again calling the above three commands will move to the next word.
If we want to move to the previously searched word we need to follow a technique called BookMarking =
var dd=txt.getBookmark();
Here the getBookMark saves a opaque string which can be used to move to the previously referrenced
textrange using the
txt.moveToBookmark(dd);
likewise you can save the Bookmark for each searched string and retrieve it back.
To search a word in firefox and other browsers we need to use window.find method
To search forward use
window.find("string to search",false,false);
First argument is string to be searched
Second false signifies no need of case sensitivity
Third false signifies forward search
To search Backward use
window.find("string to search",false,true);
First argument is string to be searched
Second false signifies no need of case sensitivity
Third true signifies backward search.
To get the selection you can use
sel=window.getSelection();
This can also be used separately if you want to select the text highlighted by the visitor.
To copy the selection to a variable use:
range=sel.getRangeAt(0);
To add the range to the selection use
sel.addRange(range);
To remove the selection from the webPage you can use
sel.removeAllRanges();
to copy the content of the webpage use
txt=document.body.CreateTextRange();
Now we need to search the desired string using findtext method
Assume string is the desired string to be searched
1)if txt.findtext(string)
{
2) txt.select() ; //will highlight the searched word
}
we need to move to the end we use
3) txt.collapse(false) ;
if we use true in this case it moves to the beginning
And again calling the above three commands will move to the next word.
If we want to move to the previously searched word we need to follow a technique called BookMarking =
var dd=txt.getBookmark();
Here the getBookMark saves a opaque string which can be used to move to the previously referrenced
textrange using the
txt.moveToBookmark(dd);
To search a word in firefox and other browsers we need to use window.find method
To search forward use
window.find("string to search",false,false);
First argument is string to be searched
Second false signifies no need of case sensitivity
Third false signifies forward search
To search Backward use
window.find("string to search",false,true);
First argument is string to be searched
Second false signifies no need of case sensitivity
Third true signifies backward search.
To get the selection you can use
sel=window.getSelection();
To copy the selection to a variable use:
range=sel.getRangeAt(0);
sel.addRange(range);
To remove the selection from the webPage you can use
sel.removeAllRanges();
to hide and make visible the textbox javascript
To hide the textbox use
var gg=document.getElementById("txtbox");
gg.style.visibility='hidden';
To make visible the textbox use:
var gg=document.getElementById("txtbox");
gg.style.visibility='visible';
Tuesday, October 4, 2011
table to have empty cells
The table to have empty cells it must be specified with   to how many want based on the cell-size.
it should be specified as:
<table>
<tr><td>hello</td><td> </td></tr>
</table>
delete the space between two tables
To delete the space between two tables:
Simply add align="left" attribute in both the tables like below and also add <br/> below the first table to avoid the second table coming to the right of the first table.
<table align="left">
other html code here
</table><br/>
<table align="left">
other html code here
</table>
Simply add align="left" attribute in both the tables like below and also add <br/> below the first table to avoid the second table coming to the right of the first table.
<table align="left">
other html code here
</table><br/>
<table align="left">
other html code here
</table>
Subscribe to:
Posts (Atom)