Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:53:34+00:00 2026-06-10T22:53:34+00:00

I didn’t write this code and I’m having trouble figuring out why I’m getting

  • 0

I didn’t write this code and I’m having trouble figuring out why I’m getting the following the error at the first e.preventDefault(). I’ve tried moving that code around within the .click event handler, passing it to function(e){}, replacing it with return false, declaring it var e = $(this.href) (don’t laugh, I’m trying to learn), I’ve checked the value being returned in the a href and it is returning the correct hash. The video plays, but I’m getting this error when I run the IE debugger. Would someone please tell me how to properly debug and fix this. Thanks

enter image description here

HTML

 <a href="#video1" class="blueBtn modal" style="width:150px;"><span>Watch Video <img width="10" height="17" src="images/bluebtn.png"></span></a></div>

Javascript

// FANCY BOX
$("a.modal").click(function(){
    var inline=$(this).attr('href');
    $.fancybox({
        'transitionIn'      : 'none',
        'transitionOut'     : 'none',
        'href'              : inline,
        'onComplete'        : function(){
            $(inline+' .flowPlayer').videoPlayer();
            $.fancybox.center(true);
        },
        'onClosed'          : function(){loc();}
    });
    e.preventDefault();         
});

$(".print").click(function(e){
    window.open("print-docs/"+$(this).parent().attr('id')+".html","print","width=1,height=1");
    e.preventDefault();
});

function loc(){
    var location=window.location.href;
    var replaceHash=location.replace(document.location.hash,"");
    window.location.assign(replaceHash);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:53:36+00:00Added an answer on June 10, 2026 at 10:53 pm

    Should be

    $("a.modal").click(function(e) { // Note the "e" parameter
        // etc
    });
    

    … instead, just like in the second click handler. See, both these functions are supplied with the jQuery Event object (a wrapper around native Event object) as a first parameter. But you still have to let JavaScript know how exactly this parameter will be referred to in your function. )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I didn't write the following code and I am not a Javascript expert. So
I didn't write the following regex, and I'm trying to figure out what it
I didn't face this error before. I have a database db , that contains
i didn't tested this code on iPhone but i'm sure (tested) it doesn't works
I didn't get the result I want from the following code: Private Sub tblView_SelectionChanged(ByVal
I didn't expect this is that complex. But I can't figure out how I
I didn't notice this question on the site already and I am having a
I didn't take any official course of Javascript. I often read this in tutorials:
I didn't find an answer to this question because I don't know if I'm
I didn't design this table, and I would redesign it if I could, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.