iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • I love the code... dot com
    143,039

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Javascript Referrer

    Javascript Referrer



    If you speak another programming language, note that Javascript actually spells referrer correctly, not referer. Two Rs in the Javascript referrrer.

    Anyway, get it like so:

    gy=document.referrer;
    document.write(gy);

    -We created a variable and named it gy because we like short variable names.
    -We grabbed the referring URL with Javascript's built-in document.referrer object and stored it into gy
    -We used Javascript's built-in document.write command to print the referrer to the browser.

    NOTE: To test this script, you'll need to point another HTML page to the HTML page this script is on. Otherwise, the referrer will be empty.

    NOTE: The ! exclamation point just before document.referrer in the following script means: if "there is not a" document.referrer.


    Free Copy and Paste Javascript Code:

    <script type="text/javascript">
    <!--

    if (!document.referrer) {
    document.write("No referrer, pal.")
    }
    else {
    document.write(document.referrer);
    }
    -->
    </script>


    Resources:
    Javascript Print
    HTML Tutorials
    Javascript If Else

    Javascript Alert
    Onclick Javascript
    Javascript Reset
    Javascript onBlur
    Javascript Query String
    Javascript innerHTML
    Javascript Focus
    Javascript SelectAll
    Javascript Close Window

    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Javascript Reset Form
    Next Article: Javascript Push Use Push on an Array in Javascript





    JavaScriptJavaScript

    David Flanagan

    New $31.49

    CSSCSS

    David McFarland

    New $23.09

    Head First HTML with CSS...Head First HTML with CSS & XHTML

    Eric Freeman, Elis...

    New $23.99

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $23.99

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39

    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99


    Of Interest:
  • To Sort an Array in Perl
  • INCREMENT and DECREMENT a Variable in Perl
  • Finding the Length (Index Numbers) of an Array in Perl
  • Use the Perl PRINT FUNCTION
  • Javascript Pop - Use Pop to Remove Items from the End of an Array in Javascript
  • Javascript Subscript Text
  • PRINT to Browser with document.write Command in Javascript
  • Change a Form Field with Javascript
  • HTML Space
  • HTML Tables
  • Make a New Paragraph Using HTML
  • Make Strikethrough Text Using HTML

  • More Articles:
  • To Reverse an Array in Perl
  • To See if a Directory Exists in Perl
  • Add to the Beginning of an Array with Unshift in Perl
  • Exit a Loop with Last
  • Javascript Alert
  • onClick Javascript
  • Use onLoad to Call More than One Function with Javascript
  • PRINT to Browser with document.write Command in Javascript
  • Environmental Variables Available in Javascript using Navigator Object
  • Mimic Typing from a Textfield in a Textarea with Javascript
  • Make a Line Return Using HTML
  • HTML Superscript Text
  • Make Italic Text Using HTML
  • Make a New Paragraph Using HTML

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    439,805
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:15 EDT