Archive for November, 2009

Print content of a element

November 25, 2009 Leave a comment

If you want to print content of a html element, with the help of javascript you can do this.  You need to call  this function and pass a argument ( element id ). Take a look of this function.

<script type=”text/javascript”>
function printSelection(node){
var content=node.innerHTML
var”,’print_content’,’width=12800,height=1000, scrollbars=1′);;
pwin.document.write(‘<html><body onload=”window.print()”>’+content+'</body></html>’);

Now time to call this function. I called this function in a hyperlink like this.
<a href=”” onclick=”printSelection(document.getElementById(‘foo’));return false”>Print</a>

When you click on “Print” then print dialog appears give print command and enjoy this script.

Click here

Categories: Javascript

How to Add Fields in Registration Form

November 18, 2009 Leave a comment


Send mail through Joomla 1.5

November 18, 2009 Leave a comment

Joomla gives simple way to send e-mail. Do not need to write multi line code, write one line code and send e-mail. Follow these steps ..

Step 1. First of all include utility class if it is not included.

Step 2. Now call this function :
JUtility:: sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cc, $bcc, $attachmentl, $replyto, $replytoname) ;

these are optional parameters
$mode=0, (default is ‘0’(zero) for plain text, 1 for html text)

Joomla 1.5x Importent variable and object

November 10, 2009 Leave a comment

Receive variable:
$variable  =  JRequest::getCmd(‘name’, ‘default’, ‘hash’);
$variable  =  JRequest::getInt(‘name’, ‘default’, ‘hash’, ‘mask’);
$variable  =  JRequest::getString(‘name’, ‘default’, ‘hash’, ‘mask’);

Get database information through  database object:
$database  = &JFactory::getDBO();

Get Current user information through user object:
$user          = &JFactory::getUser();

Categories: Joomla 1.5


November 9, 2009 Leave a comment
1.) document.getElementById(‘id’): You can access virtually any element in            the DOM. Here is the syntax …
a.) var obj    =    document.getElementById(‘id’);
alert(obj.value); {get value of a element}
alert(obj.title);  {get title of a element}’red’;  {Change color of a element}
b.) var obj    =    document.getElementById(‘id’).value;{get value of a element}
var obj1  =    document.getElementById(‘id).title; {get title of a element}


The different node methods available through DOM manipulation are as follows:
Categories: Javascript

Edit any website through javascript

November 7, 2009 2 comments

1.) Open a website which you want to edit.
2.) Now paste this code
“JavaScript:document.body.contentEditable=’true’; document.designMode=’on’; void 0”
in address bar then hit enter. Now you can write anything on this page.

3.) Note this is temporary.

Categories: Etc

Hide you file in jpeg

November 7, 2009 Leave a comment

1. Gather all the files that you wish to hide in a folder anywhere in your PC (make it in C:\hidden – RECOMMENDED).

2. Now, add those files in a RAR archive (e.g. secret.rar). This file should also be in the same directory (C:\hidden).

3. Now, look for a simple JPEG picture file (e.g. logo.jpg). Copy/Paste that file also in C:\hidden.

4. Now, open Command Prompt (Go to Run and type ‘cmd‘). Make your working directory C:\hidden.

5. Now type: “COPY /b logo.jpg + secret.rar output.jpg” (without quotes) – Now, logo.jpg is the picture you want to show, secret.rar is the file to be hidden, and output.jpg is the file which contains both.

6. Now, after you have done this, you will see a file output.jpg in C:\hidden. Open it (double-click) and it will show the picture you wanted to show. Now try opening the same file with WinRAR, it will show the hidden archive .

Categories: Etc
%d bloggers like this: