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 bookmarked this site...
    20,065

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Get Query String Using Javascript

    Get Query String Using Javascript



    To get query string using Javascript:

    hu = window.location.search.substring(1);

    document.write(hu);

    -We create a variable hu
    -Built-in Javascript properties: window.location is the entire url. search.substring(1) is the part after the question mark.
    -We write the value of hu to the browser.


    Below is a function that will break the query string into pieces for you:


    Free Copy and Paste Javascript Code:

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

    function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i=0;i<gy.length;i++) {
    ft = gy[i].split("=");
    if (ft[0] == ji) {
    return ft[1];
    }
    }
    }

    var koko = querySt("koko");

    document.write(koko);
    document.write("<br>");
    document.write(hu);

    -->
    </script>



    Resources:
    PRINT to Browser with document.write Command in Javascript
    Create a Function in Javascript



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Use innerHTML to Change Text on a Page
    Next Article: Annoy Users with onBlur in Javascript





    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    Pro CSS and HTML Design ...Pro CSS and HTML Design Patterns

    Michael Bowers

    New $29.69

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    Struts 2 in ActionStruts 2 in Action

    Don Brown, Chad Da...

    New $29.69

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $26.39

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

    Elizabeth Castro

    New $23.09

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.09


    Of Interest:
  • Substitute in Perl
  • Write a WHILE LOOP in Perl, Carefully
  • Exit a Loop with Last
  • Matching at the Beginning and End 2
  • Setting a Cookie using Javascript
  • Use OnMouseOver in Javascript
  • Change a Form Field with Javascript
  • Use onClick in Javascript
  • HTML Image
  • Make Text Bold Using HTML
  • HTML Link
  • HTML Title Tag

  • More Articles:
  • Renaming a File with Perl's RENAME Function
  • Combine, Put Two Arrays Together in Perl
  • OPEN and WRITE a Data File in Perl
  • INCREMENT and DECREMENT a Variable in Perl
  • onClick Javascript
  • Write a For Loop in Javascript
  • If, Else If, and Else in Javascript
  • Formatting Time in Javascript
  • HTML Tags
  • Make Strikethrough Text Using HTML
  • HTML Subscript Text
  • HTML Image

  • 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


    316,805
    Counter by iLoveTheCode.com


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