Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
303 views
in Technique[技术] by (71.8m points)

javascript - 为日历插件调用相同的JavaScript时出现问题(Problem when calling identical javascript for calendar plugin)

I'm using a calendar app to connect multiple different calendars.(我正在使用日历应用程序来连接多个不同的日历。)

The way they show the calendar is not really suitable for me so I've been trying to change the JavaScript but as soon as I try to call another version, even if it is exactly the same the calendar don't show, so is there some way to use my own JavaScript?(他们显示日历的方式并不十分适合我,因此我一直在尝试更改JavaScript,但是一旦我尝试调用另一个版本,即使它与日历显示的完全相同,也是如此。使用我自己的JavaScript的某种方式?) I've tried contacting the creator of the app but no luck.(我尝试联系该应用程序的创建者,但没有运气。)

Working code(工作代码)

<script type='text/javascript' src='https://panel.bed-booking.com/widget/jquery-1.10.2.min.js'></script>
<script type='text/javascript' src='https://panel.bed-booking.com/widget/main_full.js?ver=20180768'></script>
<div id='bb-calendar-0'>
  <center>
    <img style='width:50px !important; height:50px !important;' src='https://panel.bed-booking.com/widget/gfx/loader.gif' alt='' /><br/>
    <a href='http://bed-booking.com' style='color:#73b819 !important' rel='nofollow'>BedBooking</a>
  </center>
</div>
<script type='text/javascript'>
jQuery(document).ready(function() {
  new CalendarFull(
    '0097661bc090e1ca78b844285df5a9c1',
    '0',
    'bb-calendar-0',
    {
      normal: '7dbb2c',
      reserved: 'fb1643',
      nextMonth: 'ecf5e1',
      font:'81817f',
      width: 450,
      lang: 'en',
      showBBLink: 'none'
    }
  );
});
</script>

Test code with javascript at http://yourjavascript.com/31631229421/main-full.js(使用javascript测试代码,网址为http://yourjavascript.com/31631229421/main-full.js)

<script type='text/javascript' src='https://panel.bed-booking.com/widget/jquery-1.10.2.min.js'></script>
<script type='text/javascript' src='http://yourjavascript.com/31631229421/main-full.js'></script>
<div id='bb-calendar-0'>
  <center>
    <img style='width:50px !important; height:50px !important;' src='https://panel.bed-booking.com/widget/gfx/loader.gif' alt='' /><br/>
    <a href='http://bed-booking.com' style='color:#73b819 !important' rel='nofollow'>BedBooking</a>
  </center>
</div>
<script type='text/javascript'>
jQuery(document).ready(function() {
  new CalendarFull(
    '0097661bc090e1ca78b844285df5a9c1',
    '0',
    'bb-calendar-0',
    {
      normal: '7dbb2c',
      reserved: 'fb1643',
      nextMonth: 'ecf5e1',
      font:'81817f',
      width: 450,
      lang: 'en',
      showBBLink: 'none'
    }
  );
});
</script>

working fiddle https://jsfiddle.net/0gk6L9pr/(工作小提琴https://jsfiddle.net/0gk6L9pr/)

test fiddle https://jsfiddle.net/xq1t6ujv/(测试小提琴https://jsfiddle.net/xq1t6ujv/)

  ask by HippieViking translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Next time, please make your code more readable, one giant blob of code doesn't help anyone (especially yourself, because you are the one that has to work with it).(下次,请使您的代码更具可读性,一大堆代码对任何人都没有帮助(尤其是您自己,因为您是必须与之合作的人)。)

The error is in the link you provided, because it doesn't contain anything?(错误出现在您提供的链接中,因为它不包含任何内容?)

Just compare these two:(只需比较这两个:)

One is completely empty and the other actually has something you can use.(一个完全为空,而另一个实际上可以使用。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...