3

Back again with a new, difficult (hopefully not for all of you on SO!) question.

I've got this website running with a sidr plugin. It is initialized on the master Site.Master, and is working on 'nearly' all the pages. However, on a few pages, it comes up with Uncaught TypeError: Object [object Object] has no method 'sidr' and it references the Site.Master code of $(document).ready(function(){ $(#sideBar).sidr({ name: 'sidebar', side: 'left' });});.

Would anyone know why it works on most pages, but on a few it doesn't? I've checked this and this and this but to no avail. Any and all help is greatly appreciated.

Cheers

Edit:

Adding in a picture to display a bit better what is happening. As you can see the layout is completely lost, as though JavaScript has become disabled on the page. The reference to .sidr and .searchable are within the Site.Master ONLY, so I'm not sure why it's coming up like this. As mentioned in the comments, I have made sure there is only one reference to these scripts.

Thanks in advance.

Here's what it looks like on the few pages it doesn't work:

Image1

Here's what it looks like on the pages it does work on:

Extended sidebar -

Image2

Hidden sidebar -

enter image description here

Community
  • 1
  • 1
DeeKayy90
  • 817
  • 13
  • 25
  • 1
    Check the pages for which it is not working is having duplicate jQuery reference. – Prashant Lakhlani Apr 01 '14 at 04:54
  • I have looked, and only the Site.Master has the jQuery reference. – DeeKayy90 Apr 01 '14 at 04:54
  • look at developer console and you should have some javascript error or missing html close tags that is causing this issue. – Prashant Lakhlani Apr 01 '14 at 04:57
  • The developer console in Chrome and in Firebug both only state `Uncaught TypeError: Object [object Object] has no method 'sidr'`, and I've gone through the code to check for closing tags and made sure everything looks right. – DeeKayy90 Apr 01 '14 at 04:58
  • @PrashantLakhlani If you would like to add the answer of looking for a duplicate JQuery entry (non-dependent of the version) then I will mark it. You were correct, I had in one of my pages, hidden away, a reference to JQuery-1.8 and when I removed this, it works perfectly. I will mark your answer as correct as soon as you submit it. Thanks! – DeeKayy90 Apr 02 '14 at 03:00
  • 1
    no worries, glad you got your issue resolved – Prashant Lakhlani Apr 02 '14 at 05:01

1 Answers1

1

Make sure any of the sub pages, including ones that aren't referenced or used by the website, for any references to past or present versions of JQuery or Sidr. See if that helps.

  • Awesome, works a dream. I had a reference to it in an unused page and when I got rid of it, it works. Cheers – DeeKayy90 Apr 02 '14 at 03:22