加载其他页面到div不工作jquery

时间:2014-11-04 05:13:49

标签: javascript jquery html

我已经阅读了如何在线加载外部网页,但似乎无法为我工作

我也包含了这个

<script type="text/javascript" src="jquery-2.1.1.min.js"></script>

.html工作,它将内容更改为sup,但它不会加载外部页面。有什么想法吗?

jquery的

$(function() {
    $("#tab_gad").click(function() {
        $('.loadContent')
           .html('sup')
           .load('test.html');
    });
});

HTML

<div class="container">
        <div class="log_container sixteen columns"><p class="two column">Log:</p> <p class="fourteen columns log"> idle </p></div>

        <ul id="navigation" class="sixteen columns">
            <li class="dropdown"><a href="#">MMA</a>
                <ul class="sub_navigation">
                    <li id="tab_gad"><a href="#">Game Arts Design</a></li>
                    <li id="tab_iat"><a href="#">Interactive Media</a></li>
                </ul>
            </li>
            <li class="dropdown"><a href="#">FI</a>
                <ul class="sub_navigation">
                    <li><a href="#">Sub Navigation 1</a></li>
                    <li><a href="#">Sub Navigation 2</a></li>
                    <li><a href="#">Sub Navigation 3</a></li>
                </ul>
            </li>
        </ul>
        <div class="loadContent">
            <div class="img_section eight columns">            
                <img class="eight columns test_img alpha omega" src="images/wpdevshed-portfolio.jpg" alt="logo">
                <h2 class="caption">Andrew<br />Featured Portfolio1</h2>
            </div>

            <div class="img_section eight columns">            
                <img class="eight columns test_img alpha omega" src="images/bg-portfolio.jpg" alt="logo2">
                <h2 class="caption">Jack<br />Featured Portfolio2</h2>
            </div>                
        </div>        
    </div>

是因为我没有将文件放在我的localhost服务器上吗? = X

0 个答案:

没有答案