我正在使用Phonegap/Cordova编写移动应用程序.移动应用程序需要来自我编写的服务器端应用程序的信息.我创建了一个API来获取这些信息.
API所做的第一件事就是验证移动应用程序是我编写的应用程序.它使用公共API密钥和秘密API密钥执行此操作.(它们用于生成授权标头).
授权标头在移动应用程序和服务器端应用程序上生成,服务器将针对彼此检查它们是否存在差异.
它是这样的:
var SIGNATURE = SHA512( MY_APP + MY_PUBLIC_API_KEY + TIMESTAMP + NONCE + MY_SECRET_API_KEY );
var auth = "path=MY_APP,key=MY_PUBLIC_API_KEY,time=TIMESTAMP,nonce=NONCE,signature=SIGNATURE"
$.ajax( {
type = "POST",
url: url,
headers : {
"Authorization" : auth
}
} );
Run Code Online (Sandbox Code Playgroud)
// there is some regex to "decode" the auth header
// now, recreate the signature from the public variables in the auth header and check for a match (note: this includes fetching the secret from an xml file as it …Run Code Online (Sandbox Code Playgroud) 我有一个布尔变量。它存储在隐藏的输入字段中。基本上,如果用户已登录,则为false,如果未登录,则为true。
有下载按钮将链接到文件下载。我的目标是这样,如果他们没有登录,按钮将不会显示,并且链接将不起作用(如果有一个警报说他们需要登录或其他什么,那就太好了,但这会可能付出的努力超过了其价值)。
我有一个执行onloadbody 的函数:
function hide_download_btns(){
if (document.getElementById('download_btn_var_input').value == "true") {
document.getElementsByClassName('project_download_btn').item(0).hidden = true
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是它要求第 n 项.item(0)。这是它选择执行该函数的 div 的地方,但是,我希望该函数影响类名为“project_download_btn”的所有s。 div
我不喜欢 jQuery,所以如果可能的话最好避免这种情况。
我只是想从一个形状中获取文本并将其显示在其他地方(Textbox,MsgBox ......)
我知道这不正确但希望你能从中掌握这个概念.
msgbox ("Do you want to overwrite " & slide1.slot1.value &, 36, "?")
slot1 = shapename
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?