gpt4 book ai didi

在页面上加载项目时出现 Javascript 错误

转载 作者:行者123 更新时间:2023-11-30 12:56:36 26 4
gpt4 key购买 nike

我的网站有两个错误,我认为问题在于 javascript。我有显示这两个错误和代码的 Firebug 插件,但我不知道如何修复它。

语法错误:参数列表后缺少 )

window.Templates['home'] = _.template('<% if (loggedInUser == null){ %><% } %><div id="home_container">  <div id="home_title">--- is back!</div>  <div id="home_description">Created by music lovers, for music lovers.</div>  <div id="home_header">    <div class="home_header home_header_on"><a href="/explore">Search</a><span> all your favorites</span></div>    <div class="home_header"><a href="#">Share</a><span> songs with friends</span></div>    <div class="home_header"><a href="/trending">See </a> <span>What's </span> <span>Trending</span></div>  </div>  <div id="home_description"> --- is the best way to find and share music online</div>   <div id="home_search_container">    <form id="home_search_form">      <input id="home_search" class="large_input_text" placeholder="Search music" type="text" />      <input id="home_search_button" type="button" value="search" />      <span id="home_search_bg"></span>    </form>  </div>  <div id="home_share" class="hidden">    <div id="home_share_wrapper"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="lala" data-related="----:The best place for music on the web">Tweet</a>      <div id="fb-root"></div>      <div class="fb-like" data-send="false" data-layout="button_count" data-width="95" data-show-faces="true"></div>      <g:plusone size="medium"></g:plusone>    </div>  </div>  <div class="clear"></div></div><div id="home_footer_container"></div><body background="http://www.----.com/assets/images/testbg.jpg">');

另一个错误是箭头指向的地方ReferenceError: 模板未定义

var SongView = Backbone.View.extend({
showAvatar: true,
user: null,
-> template: Templates.common_songs,
tagName: "div",
className: "song_row a_song",
events: {
"click .song_view_love": "onLovedClicked",
"click .song_view_share": "onShareClicked",
"click .song_view_play_button": "onPlayButtonClicked",
"click .song_view_queue": "onQueueClicked"
}

这是固定的。然而,修复 window.Templates js 导致了新的(类型错误:be 未定义),如下所示。有什么想法吗?

Zc.prototype.Ga=function(a){var b=a[0],c=window;c.google_unique_id?++c.google_unique_id:c.google_unique_id=1;b.cb=c.google_unique_id;this.f.U&&(P(this,"hxva",1),O(this,"cmsid",this.f.H),O(this,"vid",this.f.I));isNaN(this.f.Da)||P(this,"pod",this.f.Da);isNaN(this.f.Ea)||P(this,"ppos",this.f.Ea);isNaN(this.f.r)||P(this,"scor",this.f.r);N.prototype.Ga.call(this,a);a=window;var b=a.document.domain,d=a.document.cookie,e=a.history.length,f=a.screen,g=a.document.referrer,k=Math.round((new Date).getTime()/

最佳答案

在你的第一个例子中你有一个'

window.Templates['home'] = _.template('<% i<snip>...span>What's
^

这是终止 _.template(' 中的字符串,从 What's 中删除 ' 并尝试

关于在页面上加载项目时出现 Javascript 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18877446/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com