{"action":"created","issue":{"url":"https://api.github.com/repos/qmlweb/qmlweb/issues/240","repository_url":"https://api.github.com/repos/qmlweb/qmlweb","labels_url":"https://api.github.com/repos/qmlweb/qmlweb/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/qmlweb/qmlweb/issues/240/comments","events_url":"https://api.github.com/repos/qmlweb/qmlweb/issues/240/events","html_url":"https://github.com/qmlweb/qmlweb/issues/240","id":155697760,"number":240,"title":"How to correct use this js library ","user":{"login":"toby20130333","id":4186642,"avatar_url":"https://avatars.githubusercontent.com/u/4186642?v=3","gravatar_id":"","url":"https://api.github.com/users/toby20130333","html_url":"https://github.com/toby20130333","followers_url":"https://api.github.com/users/toby20130333/followers","following_url":"https://api.github.com/users/toby20130333/following{/other_user}","gists_url":"https://api.github.com/users/toby20130333/gists{/gist_id}","starred_url":"https://api.github.com/users/toby20130333/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toby20130333/subscriptions","organizations_url":"https://api.github.com/users/toby20130333/orgs","repos_url":"https://api.github.com/users/toby20130333/repos","events_url":"https://api.github.com/users/toby20130333/events{/privacy}","received_events_url":"https://api.github.com/users/toby20130333/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/qmlweb/qmlweb/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-05-19T09:56:13Z","updated_at":"2016-06-25T08:30:56Z","closed_at":null,"body":"follow this readme \r\nI run a nodejs server and open this url localhost:3000 to show some html page\r\nbut I get the following warning and no effect\r\n\r\n> Synchronous`XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/\r\n\r\nby the way:those qml and js can be loaded\r\n\r\n`<!DOCTYPE html>\r\n<html>\r\n  <head>\r\n    <title>QML Auto-load Example</title>\r\n  </head>\r\n  <body style=\"margin: 0;\" data-qml=\"./qml/main.qml\">\r\n    <script type=\"text/javascript\" src=\"./qmlweb/lib/qt.js\"></script>\r\n  </body>\r\n</html>\r\n`\r\nnodejs code:\r\n`\r\nvar http = require(\"http\"),\r\n    url = require(\"url\"),\r\n    path = require(\"path\"),\r\n    fs = require(\"fs\"),\r\n    port = process.argv[2] || 8888;\r\n\r\nhttp.createServer(function(request, response) {\r\n\r\n  var uri = url.parse(request.url).pathname\r\n    , filename = path.join(process.cwd(), uri);\r\n\r\n  fs.exists(filename, function(exists) {\r\n    if(!exists) {\r\n      response.writeHead(404, {\"Content-Type\": \"text/plain\"});\r\n      response.write(\"404 Not Found\\n\");\r\n      response.end();\r\n      return;\r\n    }\r\n\r\n    if (fs.statSync(filename).isDirectory()) filename += '/qtquick.html';\r\n\r\n    fs.readFile(filename, \"binary\", function(err, file) {\r\n      if(err) {        \r\n        response.writeHead(500, {\"Content-Type\": \"text/plain\"});\r\n        response.write(err + \"\\n\");\r\n        response.end();\r\n        return;\r\n      }\r\n\r\n      response.writeHead(200);\r\n      response.write(file, \"binary\");\r\n      response.end();\r\n    });\r\n  });\r\n}).listen(parseInt(port, 10));\r\n\r\nconsole.log(\"Static file server running at\\n  => http://localhost:\" + port + \"/\\nCTRL + C to shutdown\");\r\n`"},"comment":{"url":"https://api.github.com/repos/qmlweb/qmlweb/issues/comments/228523502","html_url":"https://github.com/qmlweb/qmlweb/issues/240#issuecomment-228523502","issue_url":"https://api.github.com/repos/qmlweb/qmlweb/issues/240","id":228523502,"user":{"login":"Plaristote","id":1028544,"avatar_url":"https://avatars.githubusercontent.com/u/1028544?v=3","gravatar_id":"","url":"https://api.github.com/users/Plaristote","html_url":"https://github.com/Plaristote","followers_url":"https://api.github.com/users/Plaristote/followers","following_url":"https://api.github.com/users/Plaristote/following{/other_user}","gists_url":"https://api.github.com/users/Plaristote/gists{/gist_id}","starred_url":"https://api.github.com/users/Plaristote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Plaristote/subscriptions","organizations_url":"https://api.github.com/users/Plaristote/orgs","repos_url":"https://api.github.com/users/Plaristote/repos","events_url":"https://api.github.com/users/Plaristote/events{/privacy}","received_events_url":"https://api.github.com/users/Plaristote/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T08:30:56Z","updated_at":"2016-06-25T08:30:56Z","body":"@JoshuaKolden It sounds like you are including the qmlweb library after the qrc file ? It should be the other way around. The qrc object is defined within lib/qt.js. That definition would override the qrc variable as it was declared in js/qrc.js.\r\n\r\nWe'll have to see the specifics for the things that would be broken."}}
{"actor":{"display_login":"Plaristote"}}