Nodej表示玉器链接无法正确呈现

时间:2012-08-18 02:29:50

标签: node.js express pug

我有一个块中包含的以下jade文件:

.list_fl(style='position:fixed; z-index:100; width:200px;')
.ul.line_h30t
    .li
        .menu
            a(href='systemSummary')
                span(style='font-size:20px;') System summary
.ul.line_h20t
    .li
        .menu
            span(style='font-size:20px;') Game lobbies
            a(href='gamesInProgress/0')
                span(style='margin-left:5px;') - Games in progress
            a(href='scheduledGames/0')
                span(style='margin-left:5px;') - Scheduled games
            a(href='completedGamesLog/0')
                span(style='margin-left:5px;') - Completed games log
.ul.line_h20t
    .li
        .menu
            span(style='font-size:20px;') Mall status
            a(href='mallsAwaitingConfirmation/0')
                span(style='margin-left:5px;') - Malls awaiting confirmation
            a(href='mallList/0')
                span(style='margin-left:5px;') - Mall list
            a(href='blackListMalls/0')
                span(style='margin-left:5px;') - Black list malls
.ul.line_h20t
    .li
        .menu
            span(style='font-size:20px;') Users status
            a(href='userList/0')
                span(style='margin-left:5px;') - User List
            a(href='monitoredUsers/0')
                span(style='margin-left:5px;') - Monitored Users
            a(href='userBlackList/0')
                span(style='margin-left:5px;') - Black List
.ul.line_h20t
    .li
        .menu
            span(style='font-size:20px;') Commercial
            a(href='eventRegistration')
                span(style='margin-left:5px;') - Event registration
.ul.line_h20t
    .li
        .menu
            span(style='font-size:20px;') Setting
            a(href='gamesSchedule')
                span(style='margin-left:5px;') - Games schedule
            a(href='gamesLimit')
                span(style='margin-left:5px;') - Games limit

然后将其作为一个块添加到主“布局”玉器文件中(我在这里使用布局缺少一个更好的术语,我知道最近这方面对jade的更改)。这是'布局'文件:

doctype 5

HTML     头         title = title         link(rel ='stylesheet',href ='/ stylesheets / style.css')         link(rel ='stylesheet',href ='/ stylesheets / sliding-flexible-menu.css')         link(rel ='stylesheet',href ='/ stylesheets / pictogram-button.css')         link(rel ='stylesheet',href ='/ stylesheets / zebra_datepicker.css')         link(rel ='stylesheet',href ='/ stylesheets / ccSchedule.css')

    script(type='text/javascript', src='/javascripts/jquery-1.7.2.js')
    script(type='text/javascript', src='/javascripts/jquery.sliding-flexible-menu.js')
    script(type='text/javascript', src='/javascripts/ccAdmin.js')
    script(type='text/javascript', src='/javascripts/ccSchedule.js')
    script(type='text/javascript', src='/javascripts/navMenu.js')
    script(type='text/javascript', src='/javascripts/zebra_datepicker.js')
    script(type='text/javascript', src='/javascripts/divPopup.js')
    script(type='text/javascript', src='/javascripts/highcharts.js')
    script(type='text/javascript', src='/javascripts/modules/exporting.js')

body
    header(style='padding-bottom:50px;')
        include partials/header
    #container
        nav
            include partials/navMenu
        section#contents
            block content
    footer.footer
        include partials/footer
    script
        var currentPage = !{JSON.stringify(pageName)};
        var data = !{JSON.stringify(data)};
        $(document).ready(function(){
            $.navMenu.Init();
            $.ccAdmin.Init();
        });

我遇到的问题是,当呈现一个页面时,链接显示正确,例如:

http://www.mysite.com/gamesInProgress/0

如果我按照此链接,该链接将显示为:

http://www.mysite.com/gamesInProgress/gamesInProgess/0

如果有人能够对此有所启发,我将非常感激。

提前致谢!

1 个答案:

答案 0 :(得分:2)

你需要使用绝对路径而不是相对路径,如何改变

a(href='/gamesInProgress/0')