SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    May 2013
    Posts
    203
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    pass vars-localstorage is the answer or exist other way? html pages, not php pages

    What if I want from an html web form in index.html submit a web form, to be used (its data) in quote.html. In quote.html using this data to load a rent car quote - ALL CARS- via ajax.... how data in a form pass to ajax in another web page both html pages...NOT PHP Pages....

    localstorage is the answer or exist other way? html pages, not php pages

  2. #2
    SitePoint Enthusiast bronze trophy \\.\'s Avatar
    Join Date
    Oct 2013
    Location
    UK
    Posts
    72
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Via the URL, when you POST a form, use the GET method, then the receiving page can access the values of the URL.

    You wouldn't use AJAX to do this because you are loading another page, AJAX is best left for sending and fetching data from a server-side script and POSTing data.

  3. #3
    SitePoint Addict
    Join Date
    May 2013
    Posts
    203
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    all html pages in your case? how get in html page get or post vars?

    in case use local storage for this vars or stringified objs are available to next page immediately? after set localstorage in prior page...

  4. #4
    SitePoint Enthusiast bronze trophy \\.\'s Avatar
    Join Date
    Oct 2013
    Location
    UK
    Posts
    72
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    via the FORM using the GET method. You can find scripts that mimic the serialize function of PHP and you have javascripts that Base64_encode, so your URL can be kept in tact and encoded if needed.

    Your receiving page will have a string of data after the ? in the URL, this is usually in the format of x=value where x is the form field name and the value is whatever is the field value, the separator is the &


Tags for this Thread

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
  •