title: ajax post with jquery to mongodb
body: <p>I want to make a Post request using jQuery to mongodb. 
  running on app localhost:3000.
  Using mongoose I can get to display movies using:</p>
  
  <pre><code>  router.get('/', function(req, res, next) {
      mongoose.model('Movie').find(function(err, titles){
        res.render('testdb', { title: 'MYMusic',
          className: 'index',
          names: titles
        });
        console.log('names: ', titles);
      });
    });
  </code></pre>
  
  <p>But when I want to dynamically post to my database using jQuery using: </p>
  
  <pre><code> $('.save-video-button').on('click', function(event) {
  
        var obj = {
          title: 'some title'
        };
  
        var URL = 'mongodb://localhost/mydatabase';
  
        $.ajax({
          url: URL,
          type: "POST",
          data: JSON.stringify(obj),
          contentType: "application/json",
          success: function(data) {
            console.log('success --&gt; data :', data);
  
          },
          error:   function(xhr, text, err) {
            console.log('error: ',err);
            console.log('text: ', text);
            console.log('xhr: ',xhr);
            console.log("there is a problem whit your request, please check ajax request");
          }
        });
  
      });  
  </code></pre>
  
  <p>when I run this ajax request it get an error shown in google chrome dev tools console:</p>
  
  <p>XMLHttpRequest cannot load mongodb://localhost/mydatabase. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.</p>
  
  <p>How can I avoid this cross origin request?</p>
  
  <p>Thank you!</p>