小编haw*_*126的帖子

保证金:自动不在IE中工作

网址:http://cyberbat.co.uk/test容器边距:自动无效,有没有其他方法可以将它放在IE中间.

编辑:再次检查,index.php是错误的文件,我用index.html替换它.

css internet-explorer text-align margin internet-explorer-9

14
推荐指数
4
解决办法
4万
查看次数

HTML范围输入滑块在移动设备上消失.为什么?

为什么类型范围的HTML5输入会在移动设备上消失?请参阅页面,作为移动设备进行检查.我正在开发一个带有表单的简单网站,但需要表单才能在移动设备上运行.谢谢!

html css forms html5 css3

13
推荐指数
1
解决办法
3260
查看次数

CF-Hash属性和脚本神秘地添加到mailto链接

我有一个开发站点和生产站点:

我在底部有一个mailto电子邮件链接,php源代码如下:

           <section>
               <h2>Looking for a LAMP, WordPress or Drupal Developer?</h2>
               <p>Contact me today: <br/>
                <a href='mailto:mail@example.com'>mail@example.com</a>
                   <br/>
                <a href='tel:+13334445555'>333 444 5555</a>
               </p>
           </section>
Run Code Online (Sandbox Code Playgroud)

我的开发网站上的一切都很正常,生成的html如下:

                <section>
                    <h2>Looking for a LAMP, WordPress or Drupal Developer?</h2>
                    <p>Contact me today: <br>
                        <a href="mailto:mail@example.com">mail@example.com</a>
                        <br>
                        <a href="tel:+13334445555">333 444 5555</a>
                    </p>
                </section>
Run Code Online (Sandbox Code Playgroud)

然后神秘地在我的生产网站上一些javascript被添加到我的mailto链接(并且只有mailto链接,在这种情况下只是一个但我已经添加了更多并且脚本也被添加到它们中)这是生产中的html输出现场:

<section>
<h2>Looking for a LAMP, WordPress or Drupal Developer?</h2>
<p>Contact me today: <br>
<a href="mailto:mail@example.com">mail@example.com
<script cf-hash="f9e31" type="text/javascript">
/* <![CDATA[ */!function(){try{var t="currentScript"in document?document.currentScript:function()        {for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var …
Run Code Online (Sandbox Code Playgroud)

html javascript php mailto cloudflare

1
推荐指数
2
解决办法
3141
查看次数

PHP DOMDocument parentNode-&gt; replaceChild导致foreach跳过下一项

$content使用DOMDocument 解析变量中的html,以将所有iframe替换为图片。foreach仅替换ODD iframe。我已经删除了foreach中的所有代码,并发现引起该问题的代码是:'$ iframe-> parentNode-> replaceChild($ link,$ iframe);'

为什么foreach会跳过所有奇数iframe?

代码:

        $count = 1;
        $dom = new DOMDocument;
        $dom->loadHTML($content);
        $iframes = $dom->getElementsByTagName('iframe');
        foreach ($iframes as $iframe) {

            $src = $iframe->getAttribute('src');
            $width = $iframe->getAttribute('width');
            $height = $iframe->getAttribute('height');

            $link = $dom->createElement('img');
            $link->setAttribute('class', 'iframe-'.self::return_video_type($iframe->getAttribute('src')).' iframe-'.$count.' iframe-ondemand-placeholderImg');
            $link->setAttribute('src', $placeholder_image);
            $link->setAttribute('height', $height);
            $link->setAttribute('width', $width);
            $link->setAttribute('data-iframe-src', $src);

            $iframe->parentNode->replaceChild($link, $iframe);

            echo "here:".$count;
            $count++;
        }

        $content = $dom->saveHTML();

        return $content;
Run Code Online (Sandbox Code Playgroud)

这是代码的问题所在

        $iframe->parentNode->replaceChild($link, $iframe);
Run Code Online (Sandbox Code Playgroud)

php foreach iframe html-parser

1
推荐指数
2
解决办法
602
查看次数