我仍在研究Dart。我只想将.dart中定义的字符串输出到html。我查看了http://c.dart-examples.com/learn/variables/strings上的文档
我了解我需要使用“”。
当我打印查询时,我得到了很好的结果,但是当我以html输出时,它们是并排的。
那里是:
.dart:
var symbole = """
*
***
*****
*******
*********""";
var element03 = query('#exercice03');
element03.innerHTML = symbole;
print(symbole);
}
Run Code Online (Sandbox Code Playgroud)
打印给我的正是我在var符号中设置的内容,但是在我的HTML中我得到了:
My html is :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HelloWorld</title>
<link rel="stylesheet" href="HelloWorld.css">
</head>
<body>
<div id="container">
<p class="question">Exercice : Pritn the * : <span id="exercice03"></span></p>
</div>
<script type="application/dart" src="web/HelloWorld.dart"></script>
<script src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我不明白为什么在输出html中无法在dart编辑器中获得与“打印”相同的结果,有人可以帮助我解决这个问题吗?
我尝试创建一个关系/ connexion beetwen 2 selectbox
<form id="creation" name="creation">
<select name="select01" id="select01">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
</select>
<select name="select02" id="select02">
<option value="aa">aa</option>
<option value="bb">bb</option>
<option value="cc">cc</option>
</select>
</form>
Run Code Online (Sandbox Code Playgroud)
我希望我的selectbox select02在begening 处被禁用,当我点击 value02或value03时,我们启用它,当我们点击value01时,禁用它.
目前有我的代码js.我尝试从其他功能(启用选择框的radiobutton)调整它,但它似乎不起作用.我的列表在beging时被禁用,但是onclick无效...
有些身体可以帮助我吗?
var oui = document.creation.select01[0];
document.getElementById("select02").disabled=true;
oui.onclick = function() {
document.getElementById("select02").disabled=false;
}
Run Code Online (Sandbox Code Playgroud)
好的,现在,我正在使用这段代码:
<script>
var oui = document.select01;
document.getElementById("select02" ).disabled=true;
oui.onchange = function(){
document.getElementById("select02" ).disabled=false;
}
</script>
Run Code Online (Sandbox Code Playgroud)
我更改了selec01的值,然后我的select02现在启用..但是如何只定位select01的2个选项?
我正在寻找网络上的每个地方(飞镖网站,stackoverflow,论坛等),我找不到我的答案.
所以有我的问题:我需要编写一个函数,打印随机排序的列表,女巫作为参数提供.:在飞镖中也是如此.
我尝试使用地图,使用集合,使用列表...我尝试使用assert的方法,使用排序,我看看随机方法使用数学上的飞镖解决方案......没有什么可以做我想做的事情.
有人可以帮我弄这个吗?
这里有一些草案:
var element03 = query('#exercice03');
var uneliste03 = {'01':'Jean', '02':'Maximilien', '03':'Brigitte', '04':'Sonia', '05':'Jean-Pierre', '06':'Sandra'};
var alluneliste03 = new Map.from(uneliste03);
assert(uneliste03 != alluneliste03);
print(alluneliste03);
var ingredients = new Set();
ingredients.addAll(['Jean', 'Maximilien', 'Brigitte', 'Sonia', 'Jean-Pierre', 'Sandra']);
var alluneliste03 = new Map.from(ingredients);
assert(ingredients != alluneliste03);
//assert(ingredients.length == 4);
print(ingredients);
var fruits = <String>['bananas', 'apples', 'oranges'];
fruits.sort();
print(fruits);
Run Code Online (Sandbox Code Playgroud) 我创建了一个在我的#########.com帐户中登录的流程.当我把它放在我的FTP上时,它就像一个魅力.
这是问题所在:
我在我的机器上设置了一个apache本地服务器(easyPHP):localhost:8080.我在我的机器上也有一个IIS服务器端口 - > localhost:80.
我的cURL请求不起作用.这是我的代码:
$lien = 'https://#########.com/login';
$postfields = array(
'username' => 'xxx',
'password' => 'xxx'
);
$path_cookie = 'connexion.txt';
if (!file_exists(realpath($path_cookie))) touch($path_cookie);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $lien);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curl, CURLOPT_COOKIEJAR, realpath($path_cookie));
$return = curl_exec($curl);
echo($return);
echo 'error:' . curl_error($curl);
curl_close($curl);
}
Run Code Online (Sandbox Code Playgroud)
首先:是的我在我的服务器上安装了cURL,我在我的apache服务器和我的IIS服务器之间做了一些其他的cURL请求,一切正常.
其次:文件"connexion.txt"很好创建,但是空的.
第三:中($返程)响应无回声,我的服务器上的响应是" 对象转移到这里. "
第四:是的我读过这个话题,但对我帮助不大..
最后:当我尝试调试cURL请求时,错误是:
错误:SSL证书问题:无法获取本地颁发者证书
有人可以帮我吗?我会留在这里回答评论/测试/调试/回答等.
谢谢 !
我试着计算句子里有多少字母"a":"Hello Jordania".
我发现该功能包含.我这样使用它:
var phrase = "Hello Jordania;
var comptenbrdea = phrase.contains('a');
print(comptenbrdea);
Run Code Online (Sandbox Code Playgroud)
我得到"真实"作为回应.正常你会说,我知道,但我没有找到合适的功能来计算我得到一个多少时间.如果我可以检查每一个字符,我可以用循环做一些事情吗?...我迷失在http://www.dartlang.org/search.html?cx=011220921317074318178%3Ai4mscbaxtru&ie=UTF-8&hl=en&q=string_scanner ......有人可以帮助我吗?
所以我暂时得到这个脚本:
<select class="n-select" name="heure-event" id="heure-event">
<option selected="selected"></option>
<?php
for ( $heures = 0 ; $heures <= 23 ; $heures++ ){
for ( $minutes = 0 ; $minutes <= 45 ; $minutes += 15 ){
?>
<option value="<?php echo $heures.':'.$minutes;?>:00">
<?php
echo $heures.':'.$minutes;
?>
</option>
<?php
}
}
?>
</select>
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但是小问题:1:15,1:0等.
我想:01:15和1:00,
有些身体可以帮助我吗?我可能需要检查,如果$i是< 10再加入'0.$i'或类似这样的东西吗?