Print content of a element
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.
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.
How to Add Fields in Registration Form
soon!
Send mail through Joomla 1.5
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.
jimport(‘joomla.utilities.utility’);
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)
$cc=null,
$bcc=null,
$attachment=null,
$replyto=null,
$replytoname=null
Joomla 1.5x Importent variable and object
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();
DOM
node.previousSibling
Edit any website through javascript
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.
Hide you file in jpeg
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 .
Object Oriented JavaScript
Creating a class
Use object oriented javascript.
Below code write in .js file.
First of all declare a class. In JavaScript class declaration same as function.
Let create a class in JavaScript
function MyClass(){
}
Now create a function in this class
function MyClass(){
this.firstFunction = firstFunction;
function firstFunction(){
alert(“I am from class”);
}
Now call the class function through object. So we need to create object that
class.
var obj = new MyClass();
obj.firstFunction();
OutPut: A alert msg “I am from class”.