我试图通过浏览器创建基本身份验证,但我无法真正实现.
如果此脚本不在此处,则浏览器身份验证将接管,但我想告诉浏览器用户即将进行身份验证.
地址应该是这样的:
http://username:password@server.in.local/
Run Code Online (Sandbox Code Playgroud)
我有一个表格:
<form name="cookieform" id="login" method="post">
<input type="text" name="username" id="username" class="text"/>
<input type="password" name="password" id="password" class="text"/>
<input type="submit" name="sub" value="Submit" class="page"/>
</form>
Run Code Online (Sandbox Code Playgroud)
还有一个脚本:
var username = $("input#username").val();
var password = $("input#password").val();
function make_base_auth(user, password) {
var tok = user + ':' + password;
var hash = Base64.encode(tok);
return "Basic " + hash;
}
$.ajax
({
type: "GET",
url: "index1.php",
dataType: 'json',
async: false,
data: '{"username": "' + username + '", "password" : "' + password + '"}', …Run Code Online (Sandbox Code Playgroud) 我有一个链接:
<ul id="titleee" class="gallery">
<li>
<a href="#inline" rel="prettyPhoto">Talent</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我试图通过使用以下方法触发它:
$(document).ready(function() {
$('#titleee').find('a').trigger('click');
});
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
我也尝试过: $('#titleee a').trigger('click');
编辑:
我实际上需要触发这里调用的任何东西 <a href="#inline" rel="prettyPhoto">
我有一个AJAX调用,返回一些像这样的JSON:
$(document).ready(function () {
$.ajax({
type: 'GET',
url: 'http://example/functions.php',
data: { get_param: 'value' },
success: function (data) {
var names = data
$('#cand').html(data);
}
});
});
Run Code Online (Sandbox Code Playgroud)
在#canddiv 里面我会得到:
[ { "id" : "1", "name" : "test1" },
{ "id" : "2", "name" : "test2" },
{ "id" : "3", "name" : "test3" },
{ "id" : "4", "name" : "test4" },
{ "id" : "5", "name" : "test5" } ]
Run Code Online (Sandbox Code Playgroud)
如何遍历此数据并将每个名称放在div中?
更新:我想传递var value给服务器
你好,同样老,同样老...... :)
我有一个名为的表单<form id="testForm" action="javascript:test()">和一个名为的代码区域<code id="testArea"></code>
我正在使用此代码在代码区域中字符串化并显示数据:
var formData = form2object('testForm');
document.getElementById('testArea').innerHTML = JSON.stringify(formData, null, '\t');
var value = JSON.stringify(formData, null, '\t');
Run Code Online (Sandbox Code Playgroud)
我想要的是将此数据发送到JSON文件.我一直在研究这个项目:http://ridegrab.com/profile_old/如果按下Submit Query按钮,你会看到页面的头部填充.
另外我想用这段脚本发送数据:
function authenticate(userName, password) {
$.ajax
({
type: "POST",
//the url where you want to sent the userName and password to
url: 'username:password@link to the server/update',
dataType: 'json',
async: false,
//json object to sent to the authentication url
data: '{"userName": "' + userName …Run Code Online (Sandbox Code Playgroud) 我有这个表单,我试图从文本区域获取值.由于某种原因,它不想.
<form action="/profile/index/sendmessage" method="post" enctype="application/x-www-form-urlencoded">
<div class="upload_form">
<dt id="message-label"><label class="optional" for="message">Enter Message</label></dt>
<dd id="message-element">
<textarea cols="60" rows="5" id="message" name="message"></textarea></dd>
<dt id="id-label"> </dt>
<dd id="id-element">
<input type="hidden" id="id" value="145198" name="id"></dd>
<dt id="send_message-label"> </dt>
<dd id="send_message-element">
<input type="submit" class="sendamessage" value="Send" id="send_message" name="send_message"></dd>
</div>
</form>
$("input.sendamessage").click(function(event) {
event.preventDefault();
var message = $('textarea#message').html();
var id = $('input#id').val();
console.log(message + '-' + id);
});
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我有这种情况
<div ng-repeat="test in current">
<div ng-if="test.view == null">
<i class="icon ion-checkmark"></i>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
但test.view== null不起作用,也不检查test.view或test.view == ''
有任何想法吗?
谢谢
编辑:
在循环中,有时test.view,如果我这样做,有时值为NULL:
<div ng-if="!test.view">1</div>
<div ng-if="test.view">2</div>
Run Code Online (Sandbox Code Playgroud)
我只会看到 1
我有这个文字
$test1 = 'testing1';
$test1test1 = 'testing1';
$test1test1test1 = 'testing1';
$test1 = 'testing1';
Run Code Online (Sandbox Code Playgroud)
我想像这样对齐,使用标签,
$test1 = 'testing1';
$test1test1 = 'testing1';
$test1test1test1 = 'testing1';
$test1 = 'testing1';
Run Code Online (Sandbox Code Playgroud)
有没有办法在phpstorm或webstorm中这样做?
我有以下代码:
map: function (events) {
var arrayOfLatLngs = [];
var _this = this;
// setup a marker group
var markers = L.markerClusterGroup();
events.forEach(function (event) {
// setup the bounds
arrayOfLatLngs.push(event.location);
// create the marker
var marker = L.marker([event.location.lat, event.location.lng]);
marker.bindPopup(View(event));
// add marker
markers.addLayer(marker);
});
// add the group to the map
// for more see https://github.com/Leaflet/Leaflet.markercluster
this.map.addLayer(markers);
var bounds = new L.LatLngBounds(arrayOfLatLngs);
this.map.fitBounds(bounds);
this.map.invalidateSize();
}
Run Code Online (Sandbox Code Playgroud)
我最初调用此函数,它将添加所有events标记和群集的地图.
在某些其他事件中传递的泡沫点,地图将放大到新事件,但旧的事件仍然在地图上.
我尝试了this.map.removeLayer(markers);一些其他的东西,但我不能让旧的标记消失
有任何想法吗?
我想在Blogger中添加一些JavaScript.
<script type="text/javascript">
window.open("http://www.page.html", "myWindow",
"status = 1, height = 400, width = 400, resizable = 0");
</script>
Run Code Online (Sandbox Code Playgroud)
如果我编辑HTML,我添加"并'转换为quote ...
如果我添加HTML/JavaScript小部件,代码将无法运行.
我有一个"date_created":"1273185387"以epoch格式返回的json文件
我想把它转换成这样的东西 Thu, 06 May 2010 22:36:27 GMT
任何进行此转换的脚本?