0

Javascript doesn't work for the users except System admin. I checked in all files. And everyone can view the pages and sites.

How can I solve this?

<script type="text/javascript" src="/jquery.js"></script>
<script type="text/javascript" src="">

        jQuery.fn.center = function () {
            this.css("position","absolute"); 
            this.css("top", ( $(window).height() - this.height() ) / 2 + $('#s4-workspace').scrollTop() + "px");    
            this.css("left", ( -300+$(window).width() - this.width() ) / 2 + $(window).scrollLeft() + "px");    
            return this;
        } 

        jQuery.fn.centerleft = function () {
            this.css("position","fixed");    
            this.css("top", ( $(window).height() - this.height() ) / 2 + $('#s4-workspace').scrollTop() + "px");    
            this.css("left", ( -300 + $(window).width() - this.width() ) / 2 + $(window).scrollLeft() + "px");    
            return this;
        } 

        $().ready(function () {
            $('.thumbnailyatay').mouseover(function() {
                $(this).next().center().show();
            }).mouseout(function() {
                $(this).next().hide();
            });

            $('.thumbnaildikey').mouseover(function() {
                $(this).next().centerleft().show();
            }).mouseout(function() {
                $(this).next().hide();
            });
        });
    </script>   
    <style type="text/css">
    .large {
 display:none;
 }



<a class="small" >
<xsl:attribute name="href">
<xsl:value-of select="@BigPicture"></xsl:value-of></xsl:attribute>
<img class="thumbnaildikey" alt="gallery thumbnail" style="width:88px;">
<xsl:attribute name="src">
<xsl:value-of select="@BigPicture"></xsl:value-of></xsl:attribute></img>
<img class="large" alt="gallery thumbnail" style="height:800px;width:568px">
<xsl:attribute name="src"><xsl:value-of select="@BigPicture">
</xsl:value-of></xsl:attribute></img>
</a>
7
  • Could you provide code sample?
    – Alexander
    Mar 21, 2013 at 13:28
  • What you mean? Could you provide code sample? Mar 21, 2013 at 14:04
  • You need to post the actual javascript.
    – Chloraphil
    Mar 21, 2013 at 17:59
  • I add the codes to the question. Sorry for the late answers
    – e.ozmen
    Mar 22, 2013 at 6:08
  • My problem is changed.
    – e.ozmen
    Mar 22, 2013 at 7:24

2 Answers 2

3

Make sure you do not have any absolute urls in your javascript. Use server relative URLs only.

1
  • Yes, I did it .
    – e.ozmen
    Mar 21, 2013 at 15:26
1

Also ensure that where you are storing the JS files are accessible (site assests or wherever) by all users in terms of permissions etc...

Cheers,

S

3
  • I give read permission to site members. Nothing changed.
    – e.ozmen
    Mar 22, 2013 at 12:14
  • Can i ask where you have the file?
    – Stephen
    Mar 22, 2013 at 12:17
  • I found the reason. I removed src="" in the <script type="text/javascript" src="">. Thanks to all of you.
    – e.ozmen
    Mar 22, 2013 at 12:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.