简体   繁体   中英

Dead Link: Link opens in new window, but not on the page

The problem: I have a link on a page that when I click it, nothing happens, but when I right click and open in a new window, I get the image that is on the link. I've used Firefox and Chrome. I'm doing web development on my localhost before deploying to our dev environment. It works in DEV, but not on local; it had worked previously on local. This doesn't make sense to me.

The solution: I did a checkout of the pages I had been working on from our svn repository. And that didn't work.

Would I be right in thinking if the link opened in a new window then the problem is something else?

This Link:

<a type="hidden" class="highlight" id="hidden_link" href="../images/developer_notice.png"></a>

Is clicked by this form:

<form action="" id="search-form" name="search-form" method="get" onsubmit="return validateSearchForm();">

Via these javascripts:

function validateSearchForm(){
 if(!validateAccountStanding()){
    return false;
 }

 return true;
}

function validateAccountStanding(){
var accountStanding = $("#account_standing").val();

//check account standing, if it's "Not Good," alert user
//otherwise, keep going, business as usual.
if(accountStanding == "Not Good"){
    document.getElementById('hidden_link').click();
alert("!");
    return false;
}

return true;
}

I'm using fancybox to display the 'notice' to the user.

<!-- Enable fancy box -->
<link rel="stylesheet" href="../fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<link href="../js/fancybox/jquery.fancybox-1.3.1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/fancybox/jquery.fancybox-1.3.1.pack.js"></script>
<script type="text/javascript">
 $(document).ready(function(){
    //$.noConflict();
    $("a.highlight").fancybox(); 
});
</script>
<!-- Enable fancy box /end -->

I get to the alert when that form is submitted. This worked on my local previously.

Error Message from Firefox: u is undefined /ccdev2/js/fancybox/jquery.fancybox-1.3.1.pack.js Line 17

I found this question after I Googled "U is undefined."

Jquery error "u is undefined"

That fixed me up. I had declared fancybox in another php file that is included on this page. That was the one file I forgot to reset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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