0

I am uploading a script on a CEWP which uses JQUERY. The code does not execute on the first time It is loaded in IE. as pop up bow appears at the bottom of the page pormting the end user if he wants to allow blocked content..only when checked, that the page reloads..and the script gets executed

Is there a way to avoid this and have the blocked content enabled form the start

Thank you Julia

4
  • We need more info, possibly see the HTML for the page. Why is your jQuery blocked? Where are you getting the jQuery code from? Your own server? Google CDN? Is your site using https and your jQuery source http? Commented Oct 17, 2013 at 21:33
  • Here is the Script <script src="ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ var selected = $("select[title = 'ORB Scheduling Status']").val(); if(selected == "Requested") { $("TABLE.ms-formtable>TBODY>TR:eq(3)").css('display', 'none'); $("TABLE.ms-formtable>TBODY>TR:eq(4)").css('display', 'none'); } });</script> As for my site, yes it is an Https. it's a SharePoint Online Team Site. Commented Oct 17, 2013 at 21:41
  • Yep, then that's the problem. You need to make sure that your jQuery include also uses https. See Kevin's answer below. Commented Oct 17, 2013 at 21:44
  • Thank you Steve! it was the https issue as I was referencing JQuery with HTTP..Working great now Commented Oct 17, 2013 at 21:44

1 Answer 1

2

Make sure you always include your scripts with the same protocol as your domain. to do this automatically, use a protocol-relative url.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

Note, this won't work if you're working from the file system, for example, file://mypage.html

Sign up to request clarification or add additional context in comments.

1 Comment

That solved it, it was the protocol indeed. Thank you Kevin !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.