Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. passing javascript variable to php file without page refresh

passing javascript variable to php file without page refresh

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
javascriptphptutorial
3 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 4510968
    wrote on last edited by
    #1

    var clickcounts='0'; function count() { clickcounts++; alert(clickcounts); } I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example Thanks In Advance, Praveen

    M R 2 Replies Last reply
    0
    • U User 4510968

      var clickcounts='0'; function count() { clickcounts++; alert(clickcounts); } I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example Thanks In Advance, Praveen

      M Offline
      M Offline
      Mohammad Dayyan
      wrote on last edited by
      #2

      Member 4514218 wrote:

      I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example

      Yes, Ajax is the only way. For the samples, there are many samples in the web, just needs a simple searching. For example : http://forums.tizag.com/showthread.php?p=32989#post32989[^]

      1 Reply Last reply
      0
      • U User 4510968

        var clickcounts='0'; function count() { clickcounts++; alert(clickcounts); } I like to pass the clickcount value to a php file without page refresh. If AJAX is the only way give me an example Thanks In Advance, Praveen

        R Offline
        R Offline
        Ranjit Viswakumar
        wrote on last edited by
        #3

        AJAX is the way to go if you want to make calls to the server without refreshing the page. It makes XML calls to the server. Here's is a script you can use- http://whatsaranjit.com/includes/grabData.js The variables explained- this.value: variable passed as get variable q ID of div: the id of the div that should be alter to contain the new data page for processing: PHP, .NET, CF, etc page that will process q and return output Take a look and try it out. Thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups