0

我设计了一个 HTML 页面,它使用 tabber.js 脚本在我的页面上创建选项卡。在 VS 中运行时,它在基本的 html 页面中运行良好。但是在 DotNetNuke 中,我使用文本编辑器将代表选项卡式页面的 div 标签放入内容中,但它不起作用。我不能把它放在一个网站上供你测试,因为它在本地主机上。

为了让 tabber.js 包含在我的页面中,我在皮肤的 ascx 页面中输入了以下代码:

protected override void OnPreRender(EventArgs e)
{
    string scriptTag = "<script type=\"text/javascript\" src=\"/DotNetNuke/Portals/_default/skins/myBasicSkin/js/tabber.js\" ></script>";
    LiteralControl headerscript = new LiteralControl();
    headerscript.Text = scriptTag;
    Page.Header.Controls.Add(headerscript);
    Page.Controls.Add(headerscript);
    base.OnPreRender(e);        
 }

当我在 Firefox 中查看源代码时,脚本标签确实显示在页面中,当我单击脚本链接时,它确实显示了 tabber.js 脚本,因此可以找到它。我试图将 alert() 调用放入 tabber.js 以查看它是否会触发而不会触发。有任何想法吗?

编辑:

下面是我在 dotnetnuke 中的文本编辑器中放入的 html 代码。重新启动我的机器后,代码现在正在触发,但没有将 div 标签更改为类似于选项卡式查看。我还将这些 div 标签直接放在我的皮肤 (ascx) 控件中,但这没有任何区别。顺便说一句,tabber.js 是开源的,代码可以在这里找到:http ://www.barelyfitz.com/projects/tabber/tabber.js

<div class="tabber">
    <div class="tabbertab">
    <h2>Guests</h2>
    <div class="content">
    <div class="two-column">
    <h3>Welcome!</h3>
    <p>Our great joy is knowing and serving Christ. We desire to
    love Him with all our hearts and glorify Him in all we do. The
    purpose Our great joy is knowing and serving Christ. We desire to love Him with all our
    hearts and glorify Him in all we do. The purpose of Grace Life Church is to
    glorify God by obediently making and equipping disciples of Christ, in the
    Shoals and throughout the world, by the power of the Spirit."
    </p>
    <ul>
        <li><a title="Live Streaming, Service Archives, etc." href="http://www.gracelifeshoals.org/worship/listen_online">Listen Online</a></li>
        <li><a title="What we believe" href="http://www.gracelifeshoals.org/about_us/statement_of_faith">Our Statement of Faith</a></li>
        <li><a title="What to expect when visiting Grace Life" href="http://www.gracelifeshoals.org/worship/what_to_expect">What To Expect </a></li>
    </ul>
    </div>
    </div>
    </div>
    <div class="tabbertab">
    <h2>Members</h2>
    <div class="content">
    <div class="two-column">
    <h3>Grace Life Family</h3>
    <p>Members are encouraged to use this site as a resource and
    encouragment for their Christian walk. Check here regularly for updates
    and information regarding the ministries of Grace Life Church.</p>
    <h3>Check out these helpful links:</h3>
    <ul>
        <li><a href="http://www.gracelifeshoals.org/news_and_events">News &amp; Events</a></li>
        <li><a title="Information about Small Groups" href="http://www.gracelifeshoals.org/life/small_groups">Small Groups<br />
        </a></li>
        <li><a title="The evidence is in the home" href="http://www.gracelifeshoals.org/..life/family_discipleship">Family Discipleship</a></li>
        <li><a href="http://www.gracelifeshoals.org/life/worship_and_music">Worship &amp; Music</a></li>
    </ul>
    </div>
    </div>
    </div>
    <div class="tabbertab">
    <h2>Churches</h2>
    <div class="content">
    <div class="two-column">
    <h3>The Local Church</h3>
    <p></p>
    <p>God has entrusted the ministry of the Gospel to the
    local church. At Grace Life, we are striving not to be a <em>great</em>
    church but a <em>true </em>church. Believing the Bible to be God&rsquo;s
    inspired, inerrant, and infallible Word, we hold it as our sole rule and
    authority.
    </p>
    <h3>Check out these helpful links:</h3>
    <ul>
        <li><a title="Visit Anchored in Truth Ministries" href="http://www.anchoredintruth.org/">Anchored in Truth</a></li>
        <li><a title="Learn about upcoming conferences" href="http://www.anchoredintruth.org/equipping/conferences_and_seminars">Conferences </a></li>
        <li><a title="Visit the Anchored in Truth Store" href="http://store.anchoredintruth.org/">Purchase Resources</a></li>
        <li><a title="Watch or Listen online" href="http://www.gracelifeshoals.org/worship/listen_online">Listen Online</a></li>
        <li><a title="Contact Us" href="http://www.gracelifeshoals.org/about_us/contact_us">Contact Us</a></li>
    </ul>
    <p>&nbsp;</p>
    </div>
    </div>
    </div>
</div>
4

1 回答 1

0

控制面板是否可见并处于图标栏模式?如果是,请尝试将其切换到经典模式。

在此处输入图像描述

当面板处于经典模式或根本不可见(没有页面级写入权限)时,我看到了多个 javascript 故障已修复。

困难的是,这个问题通常不会在浏览器的错误控制台中显示为错误。现在我在 IE9、FF4 和最新的 Chrome 11 中使用 jQuery dropdown-check-list见证了这一点。该插件不起作用,没有错误消息,而且我还没有调试到足以知道根本原因。

于 2011-06-06T18:39:30.060 回答