Sending parameters

How can I send values from one page to another with javascript??

Comments

  • : How can I send values from one page to another with javascript??
    :

    Send the data as a Query String.

    Page 1:

    [code]





    function sendData() {
    var data = document.mf.data.value;
    var url = "page2.html";

    document.location.href = url + "?" + data;
    return false;

    }





    Data to Send:




    [/code]

    Page 2:

    [code]





    var receivedData = document.location.search.substring(1, document.location.search.length);





    The data that was sent to this page is:

    document.write(receivedData);





    [/code]

    You can write the code to seperate the Key/Value pairs!

    Cya
    Bradley q:)
  • : How can I send values from one page to another with javascript??
    :

    I've created a script that allows you to send variables like this:
    [code]
    document.location.href=MyPage.html?Variable1=value&variable2=value&variable3=value etc.
    [/code]

    just download it from my homepage www.mac-doggie.nl
    ;-)
    -mac-
    mailto:[email protected]
    the Netherlands...


  • : How can I send values from one page to another with javascript??
    :
    The both methods have a weak sides the user see the sending data onto browse address bar also the better way to send data to one page may be done by 2 additional ways. Or simply using the Post methods to hide data from browser location bar. Also escape characters are not interpreted well which give possibility of hackers attacks.
    Better and easy way to use document cookies.
    Remember that boys when you want your sites to be better secured.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories