0
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> --> OK, usable
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.sidr/1.1.1/jquery.sidr.js"></script> --> sidr() undefined

I am getting a weird bug with a bookmarklet that injects jQuery plugins into the header of the current page and what happens is that although jQuery (from cdn) gets loaded the other jQuery plugin from (cdn.js) gets the 304 not modified treatment and that library cannot be used.

This happens on some websites while it the jQuery library sidr works as expected on other sites.

What is causing this? if jQuery gets loaded from google cdn but not the jQuery plugins from cdnjs, what can I do to resolve this?

KJW
  • 15,035
  • 47
  • 137
  • 243
  • possible duplicate of [Why am I getting "(304) Not Modified" error on some links when using HttpWebRequest?](http://stackoverflow.com/questions/2603595/why-am-i-getting-304-not-modified-error-on-some-links-when-using-httpwebrequ) – Bishnu Paudel Jan 28 '14 at 06:51
  • I don't think that question has anything to do with HttpWebRequest and it doesn't reveal any insight to my problem. the 304 modified may not be the issue here, it might be that the jquery code is run before the jquery plugin is loaded. – KJW Jan 28 '14 at 07:54

1 Answers1

0

try something like this

$(document).ready(function() {
    $('#simple-menu').sidr();
});

Note

if you are using any server than use this

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.sidr/1.1.1/jquery.sidr.js"></script>

if you are using simply checking it with html file in browser than

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://cdn.jsdelivr.net/jquery.sidr/1.1.1/jquery.sidr.js"></script>
rajesh kakawat
  • 10,826
  • 1
  • 21
  • 40