Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Per our discussion in my cube just a minute ago :)</p> <p>I hit this same problem (<a href="https://stackoverflow.com/questions/16070725/ajax-post-response-from-express-js-keeps-throwing-error">Ajax post response from express js keeps throwing error</a>) trying to get an AJAX post request to work correctly.</p> <p>What got me around it is not running the file directly off the file system but instead running it from a local server. I used node to run express.js. You can install express with the following command: <code>npm install -g express</code></p> <p>Once that is accomplished, you can create an express project with the following command: <strong>express -s -e expressTestApp</strong></p> <p>Now, in that folder, you should see a file named app.js and a folder named public. Put the html files you wish to work with in the public folder. I replaced the file app.js with the following code:</p> <pre><code>var express = require('/usr/lib/node_modules/express'); var app = express(); app.use(function(err, req, res, next){ console.error(err.stack); res.send(500, 'Something broke!'); }); app.use(express.bodyParser()); app.use(express.static('public')); app.listen(5555, function() { console.log("Server is up and running"); }); </code></pre> <p>Note, the require line may be different. You have to find where your system actually put express. You can do that with the following command: <strong>sudo find / -name express</strong></p> <p>Now, start the express web server with the following command: <strong>node app.js</strong></p> <p>At this time, the webserver is up and running. Go ahead and open a browswer and navigate to your ip address (or if you're on the same machine as your server, 127.0.0.1). Use the ip address:portnumber\filename.html where port number is the 5555 in the app.js file we created.</p> <p>Now in that browser, you shouldn't (and didn't when we tested it) have any of these same problems anymore.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload