我有这个代码:
html:
<input id="register_username" type="text">
<input id="register_password" type="text">
<input id="register_repeatpassword" type="text">
<input id="register_email" type="text">
Run Code Online (Sandbox Code Playgroud)
Jquery:
$(document).ready(function(){
$('#register_username').attr('autocomplete','off');
$('#register_password').attr('autocomplete','off');
$('#register_repeatpassword').attr('autocomplete','off');
$('#register_email').attr('autocomplete','off');
});
Run Code Online (Sandbox Code Playgroud)
我想禁用某些浏览器的自动完成功能,并且实际上让用户键入整个字段但代码不起作用,下拉菜单仍然出现,用户仍然可以选择之前键入的内容.我也尝试过用户,autocomplete="off"但什么都没发生.我在这做错了什么?
我使用以下代码发布到我的Facebook粉丝页面,它工作正常.现在我想使用cronjob发布到Facebook.我知道我必须使用访问令牌,但我不知道如何设置它.我试图使用echo我自己的访问令牌和页面的访问令牌,并在post api中使用它,但这不起作用我得到了这个错误:
Uncaught OAuthException: An active access token must be used to query information about the current user.
Run Code Online (Sandbox Code Playgroud)
这是我尝试的代码:
require_once('scripts/facebook.php');
$config = array('appId' => 'xxx','secret' => 'xxx');
$params = array('scope'=>'user_likes,publish_actions,email,offline_access,publish_stream,manage_pages');
$facebook = new Facebook($config);
$user = $facebook->getUser();
if($facebook->getUser()) {
try {
$user_profile = $facebook->api('/me');
$access_token = $facebook->getAccessToken();
//echo "1. ".$access_token;
} catch(FacebookApiException $e) {
$login_url = $facebook->getLoginUrl($params);
error_log($e->getType());
error_log($e->getMessage());
}
} else {
$login_url = $facebook->getLoginUrl($params);
}
$page_id = "xxxxxxxxxxxxx";
$page_access_token = "";
$result = $facebook->api("/me/accounts");
foreach($result["data"] as …Run Code Online (Sandbox Code Playgroud) 我重新启动了eclipse并将错误更改为"错误:解析XML:解除绑定错误前缀"错误
我想在我的android phonegap应用程序中使用此插件.这是一个本地通知插件.我在此行的config.xml文件中收到错误:
<gap:plugin name="de.appplant.cordova.plugin.local-notification" version="0.6.2" />
Run Code Online (Sandbox Code Playgroud)
有一个关于这个问题的一个类似的问题在这里,但答案是不相关的我的问题.
这是我的config.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
id = "com.xxx.xxx"
version = "2.0.0">
<name>xxx</name>
<description>
xxx
</description>
<author href="http://www.example.com" email="xxx@yahoo.com">
xxx
</author>
<access origin="*"/>
<!-- <content src="xxx" /> for external pages -->
<content src="index.html" />
<preference name="loglevel" value="DEBUG" />
<!--
<preference name="splashscreen" value="resourceName" />
<preference name="backgroundColor" value="0xFFF" />
<preference name="loadUrlTimeoutValue" value="20000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="disallowOverscroll" value="true" />
-->
<feature name="App">
<param name="android-package" value="org.apache.cordova.App"/>
</feature> …Run Code Online (Sandbox Code Playgroud) 我在我的程序中使用HSQLDB.我想检查结果集是否为空.
//check if empty first
if(results.next() == false){
System.out.println("empty");
}
//display results
while (results.next()) {
String data = results.getString("first_name");
//name.setText(data);
System.out.println(data);
}
Run Code Online (Sandbox Code Playgroud)
上述方法无法正常工作.根据这个帖子我要打电话.first()或.beforeFirst()将光标停留在第一行,但.first()和.beforFirst()在HSQL不支持.我也尝试添加,connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
但我仍然得到相同的结果(我得到消息为空,数据来自数据库!!!)我在这里做错了什么?
我正在使用 parse.com 来托管我的应用程序。我已经构建了一个简单的 api 来反馈 json。网址很简单,如下所示:http://websitename.parseapp.com/api/new/1/10。现在,我的 api 是公开可见的,但我想限制访问,以便只有来自相同域名的页面才能访问它。我怎样才能用 express.js 实现这一点?
这是我所拥有的示例代码:
var express = require('express');
var app = express();
// Global app configuration section
app.set('views', 'cloud/views'); // Specify the folder to find templates
app.set('view engine', 'ejs'); // Set the template engine
app.use(express.bodyParser()); // Middleware for reading request body
// This is an example of hooking up a request handler with a specific request
// path and HTTP verb using the Express routing API.
app.get('/api/:page/:from/:to', function(req, res) {
res.render('hello', …Run Code Online (Sandbox Code Playgroud) 我的网站上有一个像facebook一样的按钮:
<div class="fb-like" data-href="https://www.facebook.com/xxx"
data-send="false" data-width="300"
data-show-faces="true">
</div>
Run Code Online (Sandbox Code Playgroud)
我想使用jQuery或java脚本来检查这个div是否在页面上100%完成加载,然后执行其他操作.
我使用$(document).ready和.load检查但是没有它们工作(他们甚至在div完成加载之前就完成了这项功能).这个div是否包含来自另一个网站的iframe这个问题?我在这做错了什么?
更新我刚试了这个,它根本不起作用:
$(document).ready(function() {
$(".fb-like").load(function (){
alert("Loaded :)");
});
});
Run Code Online (Sandbox Code Playgroud) 我有以下代码(Volley Library By Google)向我的php服务器发送POST请求并获取信息.我没有检查isset($_POST['id'])PHP 尝试代码,代码工作正常.在我开始检查时购买,php会跳过if语句并转到else意味着代码没有params正确发送.我怎样才能解决这个问题?
RequestQueue queue = Volley.newRequestQueue(Chat.this);
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.POST,
CHAT_URL_FEED, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.d("THISSSSSSSS", response.toString());
if (response != null) {
parseChatJsonFeed(response);
}
}
}, new Response.ErrorListener(){
@Override
public void onErrorResponse(VolleyError error){
VolleyLog.d("Here", "Error: " + error.getMessage());
}
}) {
@Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("id", id);
return params;
}
};
queue.add(jsonObjReq);
Run Code Online (Sandbox Code Playgroud)
我也尝试了以下代码:
RequestQueue queue = Volley.newRequestQueue(Chat.this); …Run Code Online (Sandbox Code Playgroud) 我有这个约会日期:
Mon Feb 02 2015 05:18:44 GMT+0000 (UTC)
Run Code Online (Sandbox Code Playgroud)
如何将其重新格式化为更友好的东西,例如2/2/2015
我使用的是javascript.
我尝试使用.format,dateFormat但他们都返回未定义的值.
我怎样才能做到这一点?我不想使用任何正则表达式.
我有下表:
**id** **username** **activity**
1 user1 activity-like
2 user1 activity-share
3 user3 activity-like
4 user4 activity-like
5 user1 activity-share
6 user6 activity-like
8 user1 activity-share
9 user3 activity-like
10 user5 activity-share
Run Code Online (Sandbox Code Playgroud)
(注意:没有id = 7)
我正在尝试使用php-mysql来获取user1所做的活动并获取id.在这种情况下,活动具有id(1,2,5和8).
$currentId = 5;
Run Code Online (Sandbox Code Playgroud)
如果它们存在,我希望得到下一个和前一个ID(在本例中为2和8).
$fetch = mysql_query("SELECT * FROM `main` WHERE `username` = 'user1' AND id > '$id'");
if(mysql_num_rows($fetch) == 1){
while (){
}
$result = $fetch['id'];
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何编写查询.
我正在为我的网站使用godaddy Ultimate托管计划.我有cron文件,需要大量的PHP内存来完成处理.我试过这段代码:
ini_set('memory_limit', '-1');
ini_set('memory_limit', '128M');
Run Code Online (Sandbox Code Playgroud)
但它似乎无所作为.当我在mozila firefox中运行该文件时,我收到此错误:
The connection was reset
The connection to the server was reset while the page was loading.
Run Code Online (Sandbox Code Playgroud)
我是否需要从php.ini文件中更改任何内容,我应该更改哪些内容?希望有一个我可以使用的PHP代码.(注意:cron文件会将更新发布到我的Facebook页面.但不是全部,这意味着while循环没有完成.)