我有这个简单的脚本
HTML代码
<div id='div1'>
<ul>
<li><a href='#gone'>gone</a></li>
<li><a href='#gtwo'>gtwo</a></li>
</ul>
</div>
<div id='div2'>
<ul>
<li><a href='#g1'>g1</a></li>
<li><a href='#g2'>g2</a></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
js代码
init();
function init(){
target = $('#div1').find('ul');
target.on('click','a',function(){
alert ($(this).attr('href'));
});
target.trigger('click');
}
Run Code Online (Sandbox Code Playgroud)
火怎么触发?与href #gone一起使用的第一个元素
我有这个对象:
var json = {
"alex" : [
{'count' : 1, 'date': 2},
{'count' : 2, 'date': 2},
],
"alex" : [
{'count' : 10, 'date': '1'},
{'count' : 20, 'date': '10'},
],
};
Run Code Online (Sandbox Code Playgroud)
我如何将其转换为:
var arr = [
{
name: 'alex',
data: [[10,1],[20,2]]
},
{
name: 'bob',
data: [[10,1],[20,2]]
}
]
Run Code Online (Sandbox Code Playgroud) Route::get('dashboard/{path?}', function($path= null)
{
return $path;
});
Run Code Online (Sandbox Code Playgroud)
是的,这是有道理的
如果网址是什么
dashboard/movies/funny/../..
拿到 NotFoundHttpException