小编Ali*_*Zia的帖子

我想以一种不同的方式爆炸变量

我有这个变量.

$var = "A,B,C,D,'1,2,3,4,5,6',E,F";
Run Code Online (Sandbox Code Playgroud)

我想爆炸它,以便我得到以下数组.

array(
[0] => A,
[1] => B,
[2] => C,
[3] => D,
[4] => 1,2,3,4,5,6,
[5] => E,
[6] => F
);
Run Code Online (Sandbox Code Playgroud)

我用过,explode(',',$var)但我没有得到我想要的输出.有什么建议?

php

22
推荐指数
4
解决办法
2409
查看次数

Javascript自动注销代码

我有以下代码,大部分工作,但我想知道是否有可能调整一下.所以下面的代码所做的是,如果它们没有x个毫秒的鼠标活动,则会显示一个弹出窗口,说明它们将被注销,然后当/如果你最终单击ok按钮时,脚本将自动引导你注销文件.

然而,我想要做的是,如果在x毫秒之后没有点击确定按钮,那么继续将屏幕带到logout.php文件.任何人都知道如何使用以下代码执行此操作?谢谢

// Set timeout variables.
var timoutWarning = 840000; // Display warning in 14 Mins.
var timoutNow = 100000; // Timeout in 15 mins would be 900000.
var logoutUrl = 'logout.php'; // URL to logout page.

var warningTimer;
var timeoutTimer;

// Start timers.
function StartTimers() {
    warningTimer = setTimeout("IdleWarning()", timoutWarning);
    timeoutTimer = setTimeout("IdleTimeout()", timoutNow);
}

// Reset timers.
function ResetTimers() {
    clearTimeout(warningTimer);
    clearTimeout(timeoutTimer);
    StartTimers();
    $("#timeout").dialog('close');
}

// Show idle timeout warning dialog.
function IdleWarning() {
//  $("#timeout").dialog({
    //modal: true …
Run Code Online (Sandbox Code Playgroud)

javascript

10
推荐指数
2
解决办法
3万
查看次数

我希望Google Docs嵌入式PDF查看器不显示"打开外部"链接

我正在使用谷歌文档查看器制作PDF浏览器.我正面临一个问题.我不希望用户下载pdf.如果用户单击打开外部按钮,则会打开外部应用程序并可以查看pdf.我不想要那个按钮.我能做什么?

请参阅附图.

在此输入图像描述

javascript pdf jquery google-docs google-docs-api

10
推荐指数
1
解决办法
573
查看次数

如果文本溢出,如何从<li>中删除第一个单词?

<li>如果文本溢出,我想删除我的第一个单词.

这是我的导航栏

有任何想法吗?

这是我的代码.

<div class="box-heading box-sections box-block">
    <div class="nav">
        <ul id="menu">
            <?php foreach ($products as $product){ ?>
            <li><a href="#Section<?php echo $product['product_id']; ?>"><?php echo $product['name']; ?></a></li>
            <?php } ?>
        </ul>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我想让我<li>展示ANIMALS,CARS,CITYSCAPE并从中删除"CUSTOM".

html css jquery

7
推荐指数
1
解决办法
480
查看次数

如何在Chrome中的每个打印页面上打印部分网页(标题)

我正在处理发票打印脚本.发票号码必须打印在所有打印页面的顶部.我用php来实现这个目的.但这里我只是复制html版本.这个脚本在FF和IE中工作正常,但不能在chrome中工作.在FF中,我可以看到发票编号出现在打印视图中所有页面的标题部分中.我删除了所有不必要的代码以获得清晰的代码.我需要在每个打印页面中看到"发票编号:A23000BN".有没有办法在Chrome浏览器中实现相同的目标?我的html脚本如下:

<html>
<head>
<style>
#header {
    text-align: right;
    height: 20px;
    position: fixed;
    margin: 0px;
    bottom: 0px;
}
</style>
</head>
<body>
<table width="100%">
   <tr>
      <td height="1200"></td>
   </tr>
</table>
<div class="header"> Invoice Number : A23000BN </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

7
推荐指数
1
解决办法
1270
查看次数

在mysql中获取类似的行数

我正在从事一个项目,在其中教师可以节省上课时间。他可以根据天数看到自己的时间。我用了代码

$qry = mysqli_query($con, 'select * from users left join time_slot on users.id=time_slot.u_id where users.id=' . $id);
echo '<table class="table_class" border="2">
                <tr>
                <th class="details">id</th>
                <th class="details">Date</th>
                <th class="details">start time</th>
                <th class="details">End Time</th>
                </tr>';
while ($row = mysqli_fetch_array($qry)) {
    echo '<tr>';
    echo '<td class="details">' . $row['id'] . '</td>';
    echo '<td class="details">' . $row['name'] . '</td>';
    echo '<td class="details">' . $row['day'] . '</td>';
    echo '<td class="details">' . $row['time_from'] . '</td>';
    echo '<td class="details">' . $row['time_to'] . '</td>';
    echo '</tr>';
}
echo '</table>'; …
Run Code Online (Sandbox Code Playgroud)

php mysql

7
推荐指数
1
解决办法
282
查看次数

如何将下一个输入字段集中在按键上

我正在制作移动应用程序.我想实现这个功能,在按下键的同时,下一个输入字段被聚焦.我尝试过很多东西,但似乎都没有.这是我的代码.我尝试使用onClick但是当我触摸它时,它会转到下一个字段.

<input type="number" class="mobile-verify pass" maxlength="1" name="code[]" />
<input type="number" class="mobile-verify pass" maxlength="1" name="code[]" />
<input type="number" class="mobile-verify pass" maxlength="1" name="code[]" />
<input type="number" class="mobile-verify pass" maxlength="1" name="code[]" />
Run Code Online (Sandbox Code Playgroud)

我想要一个纯JqueryJavascript解决方案.提前致谢.

html javascript jquery

7
推荐指数
3
解决办法
2万
查看次数

如何在php中将驼峰式大小写转换为大写英文单词

我有不同的字符串,它们是函数名称,例如

createWebsiteManagementUsers
Run Code Online (Sandbox Code Playgroud)

我想把它们改成

Create Website Mangement Users
Run Code Online (Sandbox Code Playgroud)

我怎样才能在 PHP 中实现它?

php

7
推荐指数
1
解决办法
5122
查看次数

使用JavaScript同时提交2个表单

我正在尝试使用javascript同时提交2个表单.但是,似乎只有第二次提交被打开,而不是第一次提交.

代码很简单:

<html>
<body>
<form id="report_0" method="POST" target="_blank" action="https://www.google.com">
   <input type="hidden" name="test1" value="1">
   <input type="submit" value="report_0">
</form>
<form id="report_1" method="POST" target="_blank" action="https://www.google.com">
   <input type="hidden" name="test2" value="2">
   <input type="submit" value="report_1">
</form>
<script>
    document.getElementById("report_0").submit();
    document.getElementById("report_1").submit();
    </script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

不能使用ajax或等价物,因为它必须是'本机'POST(由于CORS问题)

我在某处读到你不能同时提交两份表格,这对我来说没有意义.我已经尝试将目标从"_blank"更改为"form1"和"form2"但仍然没有.

非常感谢您的帮助:)

编辑

这是我实际使用的:

for (....) {
       var form = document.createElement("form");
       form.setAttribute("name", "report_"+i);
       form.setAttribute("method", "POST");
       form.setAttribute("target", "_blank");
       form.setAttribute("action", action);

       for (var key in parms) {
           var field = document.createElement("input");
           field.setAttribute("type", "hidden");
           field.setAttribute("name", key);
           field.setAttribute("value", parms[key]);
           form.appendChild(field);
       }
       console.log(form);
       document.body.appendChild(form);
       form.submit();
       document.body.removeChild(form); …
Run Code Online (Sandbox Code Playgroud)

html javascript forms

5
推荐指数
1
解决办法
7533
查看次数

如何为HTML视频添加缓冲

我在一个页面上有多个视频.

<div class="row text-center">
    <video width="320" height="240" controls class="myvideo">
        <source src="http://www.html5videoplayer.net/videos/toystory.mp4" type="video/mp4">
        Your browser does not support the video tag.
    </video>
</div>

<div class="row text-center">
    <video width="320" height="240" controls class="myvideo">
        <source src="http://www.html5videoplayer.net/videos/fantasy.mp4" type="video/mp4">
        Your browser does not support the video tag.
    </video>
</div>
Run Code Online (Sandbox Code Playgroud)

我想为他们添加缓冲事件.此外,当我点击视频1时,视频2(如果正在播放)应该自动停止.我怎样才能做到这一点?他们有一个共同的阶级.我要用它们实现id吗?

html javascript jquery html5 html5-video

5
推荐指数
1
解决办法
785
查看次数

标签 统计

javascript ×6

html ×5

jquery ×5

php ×3

css ×2

forms ×1

google-docs ×1

google-docs-api ×1

html5 ×1

html5-video ×1

mysql ×1

pdf ×1