开发者

Big problem with live site and Inline Modal Window

For some reason my popup code stopped working on an live site. I have not changed anything the last 2 months. Restarting the server did not help.

I have this problem with different users and browsers. All JS code is stored on my server. Emptying the cache does not solve the problem. When running the local thru Xammp it all works. Restoring an backup did not solve the problem.

I'm using this script

The popup won't open now but I see this in my browser:

Big problem with live site and Inline Modal Window

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<script type="text/javascript" src="includes/js/menucontents.js"></script>
<script type="text/javascript" src="includes/js/anylinkmenu.js">
</script>

<script type="text/javascript">
//anylinkmenu.init("menu_anchors_class") //Pass in the CSS class of anchor links (that contain a sub menu)
anylinkmenu.init("menuanchorclass")
</script>

<script type="text/javascript" src="includes/js/jquery.js" charset="utf-8"></script>
<script type="text/javascript" src="includes/js/jquery.floatheader.js" charset="utf-8"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('#top_header').floatHeader({
        fadeIn: 0,
        fadeOut: 0
    });
});
</script>
<script type="text/javascript" src="includes/js/jquery.jeditable.js" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
    //When you click on a link with class of poplight and the href starts with a #
    $('a.poplight[href^=#]').live('click', function() {
        var popID = $(this).attr('rel'); //Get Popup Name
        var popURL = $(this).attr('href'); //Get Popup href to define size

        //Pull Query & Variables from href URL
        var query= popURL.split('?');
        var dim= query[1].split('&');
        var popWidth = dim[0].split('=')[1]; //Gets the first query string value

        //Fade in the Popup and add close button
        $('#' + popID).fadeIn('slow').css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="images/icon/delete.png" class="btn_close" title="<?php echo $lang['sluit'] ?>" /></a>');

        //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
        var popMargTop = ($('#' + popID).height() + 20) / 2;
        var popMargLeft = ($('#' + popID).width() + 20) / 2;

        //Apply Margin to Popup
        $('#' + popID).css({
            'margin-top' : -popMargTop,
            'margin-left' : -popMargLeft
        });

        //Fade in Background
        $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
        $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies

        return false;
    });

    //Close Popups and Fade Layer
    //$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
    $('a.close').live('click', function() { //When clicking on the close...
        $('#fade , .popup_block').fadeOut(function() {
            $('#fade, a.close').remove();  //fade them both out
            location.reload(); // reload page
        });
        return false;
    });
});

Someone has put an /' in my database wich cause开发者_如何学Cd the problem :( I have removed this and now it all works.

stein\'s

I do not understand why this is the problem.


If the browser navigates to this URL (#?w=700) it means that the click event handler was not fired, and hence the default behavior of the anchor was executed (navigation to the URL).

Check the server side: try to get the JS files from your server. Type the URL of the used script file into the browser, and try to make sure that it is not served from the browser cache. (You make sure this way that the JS files are really accessible on your server.) To check the client side you could do multiple things. Make sure that the client browser has JS enabled. Check the JS console for errors. Try to debug the JS e.g. in Firebug to see what is going on.


you have to check you firebug, you should have an error there.. It can be everything, or Jquery core is not anymore on the server, or is duplicated or another JS is not there... Error console should give you some info about this


Someone has put an /' in my database wich caused the problem :( I have removed this and now it all works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜