我试图从window.location.hash变量创建数组但我很惊慌.
我的代码是:
$.each(window.location.hash.replace("#", "").split("&"), function (i, value) {
value = value.split("=");
var my_item = {value[0] : value[1]};
form_data[i] = my_item;
});
console.log(form_data);
Run Code Online (Sandbox Code Playgroud)
谢谢.
我想用javascript将当前网址转换为https版本.我怎么能这样做?
例如:http://www.abc.com - > https://www.abc.com
我在head的标签中有一些全局变量:
<script type="text/javascript">
var apiRoot = 'http://localhost:8000/api',
apiUrl = apiRoot,
apiBadgeUrl = apiRoot + '/badges',
apiLevelUrl = apiRoot + '/levels',
apiBehaviorUrl = apiRoot + '/behaviors',
apiTrophyUrl = apiRoot + '/trophies',
apiUserUrl = apiRoot + '/users',
apiWidgetPreferencesUrl = apiRoot + '/widgetPreferences';
</script>
Run Code Online (Sandbox Code Playgroud)
我想在html文件中使用角度表达式,但我的尝试失败:
{{ $window.apiRoot }} or {{ apiRoot }}
Run Code Online (Sandbox Code Playgroud) 我nl2br()用来将\n字符转换为<br />标签,但我一次不想要多个<br />标签.例如,Hello \n\n\n\n Everybody应该成为Hello <br /> Everybody.
我怎样才能做到这一点?
我通过jQuery做2个不同的ajax请求,我必须检查另一个是否有效.我怎样才能做到这一点 ?
我的ajax请求中的一个示例:
active_project_categories_ajax = $.ajax(
{
url: "/ajax/get_skill_list",
dataType: 'json',
......
});
Run Code Online (Sandbox Code Playgroud)
我需要这样的东西:active_project_categories_ajax.status()
我试图通过线加入每个圆圈,我的最终代码做了但它有一些像这样的对齐问题:

我用红色圆圈标记了一些连接部分.如你所见,它们没有正确对齐(线条不会从圆心中出来).
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<canvas id="graph" width="982" height="636" style="width:491px">
Taray?c?n?z Canvas Desteklemiyor !
</canvas>
<script type="text/javascript">
var i = 0;
var lastCoord = new Array();
var c=document.getElementById("graph");
var cxt=c.getContext("2d");
function getParam(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
function drawCircleAndLine(x, y)
{
cxt.fillStyle="#000000";
cxt.beginPath();
if(i …Run Code Online (Sandbox Code Playgroud) 我有“用户”集合,我想要每天的总用户数,例如:
01.01.2012 -> 5
02.01.2012 -> 9
03.01.2012 -> 18
04.01.2012 -> 24
05.01.2012 -> 38
06.01.2012 -> 48
Run Code Online (Sandbox Code Playgroud)
我为每个用户创建了 attritube。你能帮我查询一下吗?
{
"_id" : ObjectId( "5076d3e70546c971539d9f8a" ),
"createdAt" : Date( 1339964775466 ),
"points" : 200,
"profile" : null,
"userId" : "10002"
}
Run Code Online (Sandbox Code Playgroud) 我有一个页面,它的编码是UTF-8,如果我尝试在unix系统中运行该代码,Everythings看起来很好但是当我尝试在windows(7)中运行时,一些字符看起来是问号( ).如何在两个系统中运行代码都很好(不使用iconv).
header('Content-Type: text/html; charset=UTF-8');
setlocale(LC_ALL, 'turkish');
echo strftime("%d %B %Y, %H:%M");
Run Code Online (Sandbox Code Playgroud) 我想用jQuery选择除myclass之外的所有h1标签.例如,我想选择<h1>,但我不想选择<h1 class ="myclass">
谢谢
此代码在IE8,Firefox,Chrome等中运行良好...但ie7无法识别此行:
.defaulttable thead {border-right:55px solid#c7c9cf;}
因为我在ie7看到没有边界.我怎么解决这个问题 ?
HTML:
<table id="search_table" class="mtm defaulttable">
<thead>
<tr class="sortlinks">
<td>Hello 1</td>
<td>Hello 2</td>
</tr>
</thead>
<tbody>
...........................
</table>
Run Code Online (Sandbox Code Playgroud)
CSS:
.defaulttable {width:100%;border-collapse:collapse;}
.defaulttable thead td{font-weight:bold;background: url('/static/images/grey_fade_back.png') repeat-x 0 -2px;white-space:nowrap;}
.defaulttable thead{border-right:55px solid #c7c9cf;}
.defaulttable tbody td{border-right:1px solid #c7c9cf;}
.defaulttable td {border-top:1px solid #c7c9cf;border-bottom:1px solid #c7c9cf;border-left:1px solid #c7c9cf;padding:6px 8px 6px;}
.defaulttable .project_name{background-image:url('/static/images/mini/project.png');background-position:7px 7px;background-repeat:no-repeat;padding-left:30px}
.defaulttable .user{background-image:url('/static/images/mini/user.png');background-position:7px 7px;background-repeat:no-repeat;padding-left:30px}
.defaulttable .job_ad_title{background-image:url('/static/images/mini/pin.png');background-position:7px 8px;background-repeat:no-repeat;padding-left:30px}
.defaulttable .project_category div{}
.defaulttable .odd{background:#EFEFEF url(/static/images/button-overlay.png) repeat-x scroll 0 0}
.defaulttable .hover{background:#FEFFAF url(/static/images/button-overlay.png) repeat-x scroll 0 0} …Run Code Online (Sandbox Code Playgroud)