Details

    • Skill Level:
      Dont Know

      Description

      jquery.couch.js doesn't work for Windows 8 Metro apps. Below code works fine on browsers. However when run within a Windows 8 Metro app, it throws an error in line 665 jquery.couch.js: alert undefined.

      If this is hard to fixed, any alternative javascript library recommendation is welcome.

      <!DOCTYPE html>
      <html>
      <head>
      <title>CouchDB jQuery Examples</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <script src="js/json2.js"></script>
      <script src="js/sha1.js"></script>
      <script src="js/jquery.js"></script>
      <script src="js/jquery.couch.js"></script>
      <script src="js/jquery.dialog.js"></script>
      </head>
      <body>
      <script>

      console.log('starting');
      $.couch.urlPrefix = "http://localhost:5984";
      $.couch.db("_users").allDocs({
      success: function (data)

      { console.log(); }

      });
      console.log('done');
      </script>
      </body>
      </html>

        Activity

        Hide
        rnewson Robert Newson added a comment -

        Clearing a few inappropriately set fields.

        Show
        rnewson Robert Newson added a comment - Clearing a few inappropriately set fields.
        Hide
        rnewson Robert Newson added a comment -

        It seems this environment doesn't support alert(str), which is used in several places in jquery.couch.js. Is there an equivalent function?

        Show
        rnewson Robert Newson added a comment - It seems this environment doesn't support alert(str), which is used in several places in jquery.couch.js. Is there an equivalent function?
        Hide
        jameshowe James Howe added a comment -

        I think this is how you're supposed to do it, but I'm unable to test.

        function alert(str) {
        var msg = new Windows.UI.Popups.MessageDialog(str);
        msg.showAsync().then();
        }

        Show
        jameshowe James Howe added a comment - I think this is how you're supposed to do it, but I'm unable to test. function alert(str) { var msg = new Windows.UI.Popups.MessageDialog(str); msg.showAsync().then(); }
        Hide
        rnewson Robert Newson added a comment -

        That was my conclusion also, but isn't that just absolutely foul?

        Show
        rnewson Robert Newson added a comment - That was my conclusion also, but isn't that just absolutely foul?
        Hide
        rnewson Robert Newson added a comment -

        Dale Harvey suggests that instead of adding that Windows abomination, we a) change jquery.couch.js to throw an exception instead of alert(str) and b) have Futon catch exceptions and report them appropriately. This strikes me as a very sane proposal.

        Show
        rnewson Robert Newson added a comment - Dale Harvey suggests that instead of adding that Windows abomination, we a) change jquery.couch.js to throw an exception instead of alert(str) and b) have Futon catch exceptions and report them appropriately. This strikes me as a very sane proposal.
        Hide
        sbisbee Sam Bisbee added a comment -

        Agreed - alert() in a bground lib is crazy. I will write a patch on the plane.

        Show
        sbisbee Sam Bisbee added a comment - Agreed - alert() in a bground lib is crazy. I will write a patch on the plane.
        Hide
        sbisbee Sam Bisbee added a comment - - edited

        And here are the files now that I'm off the plane. Also on github (jqueryAlert branch): https://github.com/sbisbee/couchdb/tree/jqueryAlert

        Show
        sbisbee Sam Bisbee added a comment - - edited And here are the files now that I'm off the plane. Also on github (jqueryAlert branch): https://github.com/sbisbee/couchdb/tree/jqueryAlert
        Hide
        sbisbee Sam Bisbee added a comment -

        Breaking out the white space fix per Newson's request (in IRC).

        Cheers.

        Show
        sbisbee Sam Bisbee added a comment - Breaking out the white space fix per Newson's request (in IRC). Cheers.
        Hide
        sbisbee Sam Bisbee added a comment -

        Rebased the branch on master's HEAD - the original patches were written quite a long time ago.

        Re-attached the updated patches and updated my jqueryAlert branch on github.

        Cheers.

        Show
        sbisbee Sam Bisbee added a comment - Rebased the branch on master's HEAD - the original patches were written quite a long time ago. Re-attached the updated patches and updated my jqueryAlert branch on github. Cheers.
        Hide
        rnewson Robert Newson added a comment -

        Sam Bisbee's patch applied to master and 1.2.x

        Show
        rnewson Robert Newson added a comment - Sam Bisbee's patch applied to master and 1.2.x
        Hide
        janl Jan Lehnardt added a comment -

        Thank you guys, I wanted this to happen since forever!

        Show
        janl Jan Lehnardt added a comment - Thank you guys, I wanted this to happen since forever!

          People

          • Assignee:
            Unassigned
            Reporter:
            pokerincome Chang Luo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development