SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Rust on interpreting javascript form variables... help

    I have the following javascript:
    Code JavaScript:
    function getKeywords() {
        var url = 'keywords.php';
        rand = parseInt(Math.random()*9999999999);
        var modurl = url+"?rand="+rand;
        http.open("GET", modurl, true);
        http.onreadystatechange = useHttpResponse;
        http.send(null);
    }

    How would I make modurl incorporate the POST variable 'page' onto the string? Thanks.
    Have a good day.

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function getKeywords() {
        var url = 'keywords.php';
        rand = parseInt(Math.random()*9999999999);
        var modurl = url+"?rand="+rand;
        http.open("POST", modurl, true);
        http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        http.onreadystatechange = useHttpResponse;
        http.send("page="+encodeURIComponent("foo"));
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •