您好我正在尝试运行此代码,但每次打开我的网页时它都没有加载,我没有得到文本我在文件"money.php"中用PHP回显.但是,如果我在浏览器中打开控制台并运行代码,它会加载.有谁知道我怎么解决这个问题?
<script type="text/javascript">
$('[data-update]').each(function() {
var self = $(this);
var target = self.data('update');
var refreshId = setInterval(function() { self.load(target); }, self.data('refresh-interval'));
});
</script>Run Code Online (Sandbox Code Playgroud)
<div data-update="money.php" data-refresh-interval="500">Run Code Online (Sandbox Code Playgroud)
Soo ive想出了如何通过id获取元素,但我不知道我怎么能按名称获取元素这是我的代码:
private void SendData()
{
webBrowser1.Document.GetElementById("textfield1").SetAttribute("value", textBox1.Text);
webBrowser1.Document.GetElementById("textfield2").SetAttribute("value", textBox1.Text);
}
Run Code Online (Sandbox Code Playgroud)
问题是在我的HTML代码中只有textfield1是一个id但textfield2是名字soo我想弄清楚如何获取textfield2
这是我的HTML代码:
<html>
<input type="text" id="textfield1" value="TEXT1"><br>
<input type="text" name="textfield2" value="TEXT2"><br>
<input type="submit" value="Submit">
</html>
Run Code Online (Sandbox Code Playgroud) 好的,所以我知道如何按ID或数字排序
$getTicket = $sql->query("SELECT * FROM `ticket`
WHERE `user`='$user->name'
ORDER BY `id` DESC");
Run Code Online (Sandbox Code Playgroud)
我在票证表中有状态,并且我有三件事:
1)已回答2)未答复3)完成
我想以这种方式对它进行排序:
1)未答复
2)已回答
3)完成
有没有办法做到这一点?
我试图让我的WebBrowser控件选择一个单选按钮,并单击一个没有任何 ID 或名称的提交按钮。
这是网页中的html代码:
<form method="post">
<input type="radio" name="chosen" value="3" id="a3">
<input type="radio" name="chosen" value="2" id="a2">
<input type="radio" name="chosen" value="1" id="a1">
<input value="Next" type="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
这是我尝试过的 C# 代码:
wbv(3); //This part just check every 3 seconds to see if the page the page has loaded before continuing with the code
webBrowser1.Document.GetElementsByTagName("input").GetElementsByName("chosen")[2].InvokeMember("click");
webBrowser1.Document.GetElementsByTagName("input").GetElementsByValue("Next")[0].InvokeMember("click");
Run Code Online (Sandbox Code Playgroud)
我需要帮助弄清楚如何让我的代码选择radio值为 3 的submit按钮,然后单击该按钮。