SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Posts
    453
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    saving js var data in a mysql table without clicking or inputting by the user.

    How do I save js var data in a mysql table without clicking or inputting by the user based this script? The only way know how to get JS var data into a mysql database is by create an XMLHttpRequest object, but that doesn't seem appropriate in this situation. Is there another way? If so, what do you suggest?
    HTML Code:
    <html>  
     <head>  
     <title>onscroll test</title>  
      
     <script type="text/javascript">  
     window.onscroll = scroll;  
     
     function scroll(){  
     var down_scroll = window.pageYOffset;  
     //alert ("Down_value: " + down_scroll);
     }  
    
    </script>  
    </head>  
    <body>  
    
    <p>item1</p> <p>item2</p> <p>item3</p> <p>item4</p> <p>item5</p>  
    <p>item6</p> <p>item7</p> <p>item8</p> <p>item9</p> <p>item10</p> 
    <p>item11</p> <p>item12</p> <p>item13</p> <p>item14</p> <p>item15</p> 
    <p>item16</p> <p>item17</p> <p>item18</p> <p>item19</p> <p>item20</p>
    <p>item21</p> <p>item22</p> <p>item23</p> <p>item24</p> <p>item25</p>
    <p>item26</p> <p>item27</p> <p>item28</p> <p>item29</p> <p>item30<p>
       
    </body>  
    </html>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by nichemtktg View Post
    How do I save js var data in a mysql table without clicking or inputting by the user based this script? The only way know how to get JS var data into a mysql database is by create an XMLHttpRequest object
    Not that I know of. What is the context of the behaviour?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •