我有这个网址:
website.com/con?blog=true
Run Code Online (Sandbox Code Playgroud)
我在JavaScript中所做的是:
if (getURLparams(blog)) {
RandomFunction();
// change the url
window.history.replaceState({}, '?blog=true', "blog=false");
}
Run Code Online (Sandbox Code Playgroud)
但是,我不想使用blog=false,实际上我想在那里使用空字符串。我试过了""/ ''但是他们没有用。有什么想法或选择吗?谢谢
我有一个带有函数的代码,其中我试图array在下一行定义一个then 推送到它:
function Spot(value) {
this.x = null;
this.y = null;
this.values = [];
this.values.push(value);
}
Run Code Online (Sandbox Code Playgroud)
我试过这个:
this.values = [].push(value);
Run Code Online (Sandbox Code Playgroud)
和
this.values = (this.values || []).push(value);
Run Code Online (Sandbox Code Playgroud)
但是失败了。是不是代码有问题.....
我正在从我的数据库中检索一些数据并使用PHP来显示它.那部分它工作得很好.然后,我希望所呈现的数据也是一个链接.我一直在尝试将输出包装在<a>标签内,但到目前为止还没有成功.
我无法弄清楚当我将其包装在<a>标签内时,为什么我的数据上没有链接:
<?php
while ($row = mysqli_fetch_array($query)) {
echo
"<tr>
"?> <a href="http://example.com"> <?php echo "<td>
{$row['Exam']} //This is my output
</td>"?></a>
</tr>\n";
} ?>
Run Code Online (Sandbox Code Playgroud)