Copy JavaScript Source Code

I don't have a beginner's tutorial on JavaScript on my site yet. (I plan to some day). These examples are really for people who already know the basics of using JavaScript in a web page. But below are some basic instructions for viewing and copying JavaScript source code. Note that the technique you will use  depends on whether your browsing with Microsoft Internet Explorer or Netscape Navigator.

Microsoft Internet Explorer

If you're browsing with Microsoft Internet Explorer:

  1. Right-click whatever page you're viewing and choose View Source. The page appears in Notepad.
  2. To copy the page to your own PC, choose File -> Save As from Notepad's menu bar.
  3. From the Save In drop-down list, choose a folder for storing the saved page. You can choose Desktop to put the file right on your Windows desktop
  4. Click the Save button.

To open that saved file on your PC, and view its source, see below.

Netscape Navigator

Netscape Navigator's View Source option often hides much of the JavaScript code in a page. So if you're browsing with Navigator, follow these steps to copy and view JavaScript source code:

  1. While viewing the page that contains the script you want to copy, choose File -> Save As from Navigator's menu bar.
  2. In the dialog box that appears, choose a folder from the Save In drop-down list. In Windows 95/98 you can choose Desktop to put the file right on your Windows desktop)
  3. Click the Save button.

A copy of the page is now on your PC, in whatever folder you specified in step 2. (Or on your Windows desktop.) To see the code, read the next section.

Opening Saved Source Code

Once you've saved a page from the web to your own PC, you can open it in Notepad or any other text editor to see the source code. In Windows 95/98, the easiest way is to do that is:

  1. Locate the icon for the downloaded file, and right-click it.
  2. Choose Sent To -> Notepad.

The page opens in Notepad, or whatever text editor you're using. You can now cut-and-paste using standard Windows techniques.

Tip: If Notepad isn't on your Send To menu, you can add it. See my tutorial on Customizing Your Send To Menu for this all-important skill!

 


Top   JavaScript Examples   Coolnerds Home

 

Hit Counter
Hosted by www.Geocities.ws

1