{"action":"created","issue":{"url":"https://api.github.com/repos/huei90/snap.svg.zpd/issues/25","labels_url":"https://api.github.com/repos/huei90/snap.svg.zpd/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/huei90/snap.svg.zpd/issues/25/comments","events_url":"https://api.github.com/repos/huei90/snap.svg.zpd/issues/25/events","html_url":"https://github.com/huei90/snap.svg.zpd/issues/25","id":55361658,"number":25,"title":"How can I open an svg file and have snap.svg and snap.svg.zpd use it?","user":{"login":"khovorka","id":2610587,"avatar_url":"https://avatars.githubusercontent.com/u/2610587?v=3","gravatar_id":"","url":"https://api.github.com/users/khovorka","html_url":"https://github.com/khovorka","followers_url":"https://api.github.com/users/khovorka/followers","following_url":"https://api.github.com/users/khovorka/following{/other_user}","gists_url":"https://api.github.com/users/khovorka/gists{/gist_id}","starred_url":"https://api.github.com/users/khovorka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khovorka/subscriptions","organizations_url":"https://api.github.com/users/khovorka/orgs","repos_url":"https://api.github.com/users/khovorka/repos","events_url":"https://api.github.com/users/khovorka/events{/privacy}","received_events_url":"https://api.github.com/users/khovorka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-24T06:56:19Z","updated_at":"2015-01-24T07:01:17Z","closed_at":null,"body":"Hello,\r\n\r\nI am trying to open an svg file that I saved out of snap.svg and I can save and load the file.\r\nHowever, I can't do anything with it. I use the following s = Snap('#svg2');\r\nto create the s variable. then at some poing I use s = '' or s = undefined (I tried both)\r\nthen I remove the entire SVG section and of course all content using jQuery, then I load the svg\r\nfile and add the content where it should be and it displays perfectly. However, I get a message\r\nthat s is null even after using s = Snap('#svg2') again to reintialize the variable after the\r\ncontect has successfully loaded.\r\n\r\nHere  is the code block:\r\n              s = undefined;\r\n              $('#svg2').remove();\r\n              $('#workspace').load(\"uploads/test.svg\");\r\n              var s = Snap(\"#svg2\");\r\n              s.zpd('init');\r\n              s.zpd({ drag: false });\r\n\r\nI don't know how to resolved this and be able to continue working with the file I loaded in so\r\nSnap.svg.\r\n\r\nAll help is appreciated as I really need to have this working asap.\r\n\r\nKim H.\r\n"},"comment":{"url":"https://api.github.com/repos/huei90/snap.svg.zpd/issues/comments/71303393","html_url":"https://github.com/huei90/snap.svg.zpd/issues/25#issuecomment-71303393","issue_url":"https://api.github.com/repos/huei90/snap.svg.zpd/issues/25","id":71303393,"user":{"login":"khovorka","id":2610587,"avatar_url":"https://avatars.githubusercontent.com/u/2610587?v=3","gravatar_id":"","url":"https://api.github.com/users/khovorka","html_url":"https://github.com/khovorka","followers_url":"https://api.github.com/users/khovorka/followers","following_url":"https://api.github.com/users/khovorka/following{/other_user}","gists_url":"https://api.github.com/users/khovorka/gists{/gist_id}","starred_url":"https://api.github.com/users/khovorka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khovorka/subscriptions","organizations_url":"https://api.github.com/users/khovorka/orgs","repos_url":"https://api.github.com/users/khovorka/repos","events_url":"https://api.github.com/users/khovorka/events{/privacy}","received_events_url":"https://api.github.com/users/khovorka/received_events","type":"User","site_admin":false},"created_at":"2015-01-24T07:01:17Z","updated_at":"2015-01-24T07:01:17Z","body":"Ok, I solved the issue. It was timing related and by using a callback that was all I had to do.\r\nThanks,\r\nKim H."}}