1 Reply Latest reply on Dec 12, 2006 9:50 AM by dempster

    cfhttp and javascript

    obouillaud Level 1
      Hi I need to call a page "as if it were by a web browser" which means that the Javascript in the page must be interpreted.

      I use a JS tag which provides me statistics about the command process on my website (how many display the shopping cart, how many fill the adress form, ...) (same process as google analytics)
      At the end I need to make the visitors display a page with the javascript tag inside to retrieve the information "ok the order has been paid and is xyz dollars".
      As I use an external payment system (like paypal for example), there is no page called at the end of the process.
      - the client can stay on the bank page that says "ok your order has been paid" and never come back on my site
      - The bank calls a page on my server to say "ok the order number abcd has been paid" ... in this page I can do whatever I want like calling a page using cfhttp...

      So I tried to call a page where I have my JS tag... too bad It returns raw html and does not interpret the Javascript.
      I tried to embed the page in a flashpaper cfdocument... but nothing new... it still doesn't work.

      I have no solution to change the Javascript called by my tag (hosted on another server, not managed by me ; the tag use javascript variables (url parameter, screen resolution...so it couldn't be changed by something else))
      So I really need a way to (server side) call a page and makes it interpreted like a web browser do.

      Some Suggestions ?
        • 1. Re: cfhttp and javascript
          dempster Level 1
          When the server uses CFHTTP, it simply sends an http request to a host and receives a response. As you noted, this is data in ASCII text format. As a programming language designed to be executed by a browser, JavaScript would be hard to interpret on your server. It uses variables and commands specific to the browser environment (screen resolution, windows, back/forward, etc.). Is there some other way you can approach your problem?