3
votes

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

1
Check the pages for which it is not working is having duplicate jQuery reference. - Prashant Lakhlani
I have looked, and only the Site.Master has the jQuery reference. - DeeKayy90
look at developer console and you should have some javascript error or missing html close tags that is causing this issue. - Prashant Lakhlani
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
no worries, glad you got your issue resolved - Prashant Lakhlani

1 Answers

1
votes

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.