{"action":"created","issue":{"url":"https://api.github.com/repos/Xajax/Xajax/issues/38","repository_url":"https://api.github.com/repos/Xajax/Xajax","labels_url":"https://api.github.com/repos/Xajax/Xajax/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/Xajax/Xajax/issues/38/comments","events_url":"https://api.github.com/repos/Xajax/Xajax/issues/38/events","html_url":"https://github.com/Xajax/Xajax/issues/38","id":164646622,"number":38,"title":"Newb Q: Can I call from JS and return a booll rather than just effecting the DOM? To hide a secret key..","user":{"login":"dylanh724","id":8840024,"avatar_url":"https://avatars.githubusercontent.com/u/8840024?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanh724","html_url":"https://github.com/dylanh724","followers_url":"https://api.github.com/users/dylanh724/followers","following_url":"https://api.github.com/users/dylanh724/following{/other_user}","gists_url":"https://api.github.com/users/dylanh724/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanh724/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanh724/subscriptions","organizations_url":"https://api.github.com/users/dylanh724/orgs","repos_url":"https://api.github.com/users/dylanh724/repos","events_url":"https://api.github.com/users/dylanh724/events{/privacy}","received_events_url":"https://api.github.com/users/dylanh724/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-09T03:10:16Z","updated_at":"2016-07-09T08:59:19Z","closed_at":null,"body":"I'm wondering if I can use Xajax to hide secret keys ..\r\n\r\nCallAPI(secretKey());\r\n\r\nthen they would get the secret key via xajax php function and it wouldn't expose it via source.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/Xajax/Xajax/issues/comments/231524247","html_url":"https://github.com/Xajax/Xajax/issues/38#issuecomment-231524247","issue_url":"https://api.github.com/repos/Xajax/Xajax/issues/38","id":231524247,"user":{"login":"dylanh724","id":8840024,"avatar_url":"https://avatars.githubusercontent.com/u/8840024?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanh724","html_url":"https://github.com/dylanh724","followers_url":"https://api.github.com/users/dylanh724/followers","following_url":"https://api.github.com/users/dylanh724/following{/other_user}","gists_url":"https://api.github.com/users/dylanh724/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanh724/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanh724/subscriptions","organizations_url":"https://api.github.com/users/dylanh724/orgs","repos_url":"https://api.github.com/users/dylanh724/repos","events_url":"https://api.github.com/users/dylanh724/events{/privacy}","received_events_url":"https://api.github.com/users/dylanh724/received_events","type":"User","site_admin":false},"created_at":"2016-07-09T08:59:19Z","updated_at":"2016-07-09T08:59:19Z","body":"Heya @edrobinson this is exactly what I'm looking for :) \r\n\r\nHowever, I'm seeing function not found:\r\n\r\n```\r\nkeys.php\r\n<?php\r\ninclude './xajax/xajax_core/xajax.inc.php';\r\n$xajax = new xajax();\r\n$xajax->register(XAJAX_FUNCTION, 'getGSKey');  \r\n$xajax->processRequest();\r\n\r\nfunction getGSKey()\r\n{\r\n    $response = new xajaxResponse();\r\n    $response->script(\"var gsKey = 'saYGr3qw0am4uM2kgCC9NKvTK9qD36ov'\");\r\n    return $response;\r\n}\r\n?>\r\n```\r\n\r\nindex.php\r\n```\r\n<?php\r\nrequire_once('./keys.php');\r\n...\r\n?>\r\n```\r\n\r\nmyjs.js\r\n```\r\n...\r\nfunction getKey() {\r\n    alert( getGSKey() );\r\n}\r\n...\r\n```\r\n\r\nThe result is:\r\n**Uncaught ReferenceError: getGSKey is not defined**"}}
{"actor":{"display_login":"dylanh724"}}