简体   繁体   English

在SharePoint上使用JQuery。 脚本可以在两种浏览器中的小提琴中工作,但不能在IE中的页面上工作

[英]Using JQuery on SharePoint. Scripts work in a Fiddle on both browsers, but doesn't work on page in IE

Using SharePoint 2010 on-prem. 在本地使用SharePoint 2010。 Loading up some JS in a content editor webpart to show some data when a button is clicked. 在内容编辑器Webpart中加载一些JS,以在单击按钮时显示一些数据。 After my first attempt I had it working in Chrome but nothing would happen in IE. 第一次尝试后,我在Chrome上运行了它,但是在IE中什么也没有发生。 It's a simple removeClass function and it is working on my fiddle in both browsers: https://jsfiddle.net/1kqhmL2j/1/ I have had issues using show/hide in the past which is why I'm using a Display: none class. 这是一个简单的removeClass函数,并且可以在两种浏览器中使用: https : //jsfiddle.net/1kqhmL2j/1/过去我在使用show / hide时遇到了问题,这就是为什么我在使用Display:类。 Everything is !important because SharePoint. 一切都是重要的,因为SharePoint。

Not really sure where to start on the trouble shoot, as most searches of these terms don't seem to get me anything SharePoint specific. 不太确定从哪里开始解决问题,因为这些术语的大多数搜索似乎都无法为我提供SharePoint的任何功能。 Have tried using the JQuery library directly on page as opposed to linked from Google's CDN, played with where it loads on the page, etc. Any help would be hugely appreciated. 尝试过直接在页面上使用JQuery库,而不是从Google的CDN进行链接,在页面上的加载位置进行播放等。任何帮助将不胜感激。

The scripts: 脚本:

$(document).ready(function(){
            $(".but1").click(function(){ 

                    $(".blurb1").removeClass("hidden");


                });
         }); 

$(document).ready(function(){
            $(".but2").click(function(){ 

                    $(".blurb2").removeClass("hidden");


                });
         }); 

$(document).ready(function(){
            $(".but3").click(function(){ 

                    $(".blurb3").removeClass("hidden");


                });
         }); 

$(document).ready(function(){
            $(".but4").click(function(){ 

                    $(".blurb4").removeClass("hidden");


                });
         }); 

$(document).ready(function(){
            $(".but5").click(function(){ 

                    $(".blurb5").removeClass("hidden");


                });
         }); 

使用早期版本的JQuery解决了它-抱歉

In your environment, is basic JavaScript working? 在您的环境中,基本的JavaScript是否有效? ie is it a problem that JavaScript itself is not working, as opposed to just an issue with your script syntax? 即JavaScript本身不起作用是一个问题,而不是脚本语法有问题吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM