繁体   English   中英

在Wordpress Post中使用Ajax提取HTML内容

[英]Pulling HTML content using ajax in wordpress post

好的,我目前正在一个网站上,我想在每个帖子中嵌入一个时间表。 我正在使用WordPress。 我插入的时间线在发布后会有所不同,因此无法将此时间线插入到我正在使用的实际主题中吗? 我对PHP,HTML和JS也很陌生。 但是我搜索了很多论坛,无法为我的生活弄清楚如何做到这一点。 无论如何,这是我的时间表的链接。 http://derikgrass.com/timeline/xml/2012-2014/pbj/index.html

这是使用iFrame嵌入到我的网站中的时间轴的链接。 http://www.derikgrass.com/events/?p=526

只有当您单击时间线中的事件时,时间线会延伸,iFrame才需要比时间线本身大得多时,iFrame才能发挥作用,正如您从我提供的链接中看到的那样。 这是时间轴html代码:

<meta charset="utf-8">


<title>TimelineXML</title>
<meta name="description" content="">


<link rel="stylesheet" href="css/timelinexml.sleek.css">

    <section class="demo">
        <p> <br/><br/> </p>
        <div class="demo-box">
        <div id="my-timeline">
            <div class="timeline-html-wrap" style="display: none">



            </div>
            </div>
        </div>
    </section>

</div>



<!-- JavaScript at the bottom for fast page loading -->

<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>


<!-- scripts concatenated and minified via build script -->

<script defer src="js/mylibs/timelinexml.js"></script>
<script defer src="js/script.js"></script>
<!-- end scripts -->

我想直接将其嵌入到我创建的特定帖子中。 如果有人能够帮助我编写代码以嵌入此时间线,我将非常感激。 谢谢。

我认为您的意思是您只想将他的内容放入HTML

<iframe src="http://derikgrass.com/timeline/xml/2012-2014/pbj/index.html" scrolling="no" height="400" width="900"> </iframe>

并更改宽度。

但是,您应该转到源代码(因此请单击该链接),您会看到他使用了一个不错的js文件来使其正常工作。 如果这样做,您会看到他正在使用以下脚本:

http://codecanyon.net/item/jquery-timelinexml/1448100

我不喜欢那里的脚本,因为我认为它们是时髦的网站,但是,嘿,这是您的计算机和服务器。 你决定。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM