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 7709581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:53:53+00:00 2026-06-01T00:53:53+00:00

We have a CKEditor in place, on a ASP.Net MVC 3 page: var editor

  • 0

We have a CKEditor in place, on a ASP.Net MVC 3 page:

var editor = CKEDITOR.replace(...);

Inside this editor we use some plugins to create several types of elements, the element causing trouble is created with this structure:

<div backendname="asfasdf" class="editableArea" contenteditable="false" displayname="asdfasdf"
     fieldheight="50" fieldlength="610" fieldtype="5" maxchars="0" required="true">
   <a href="google.com">
      <img align="top" alt="" hspace="0" src="http://someaddress/img.jpg"
           style="border-width: 0pt; border-style: solid; margin: 0pt;
           width: 420px; height: 315px;" vspace="0" />
   </a>
</div>

When creating this element, we are attaching (via jQuery) the click event with a function of our own, which sums up to this:

$jq(field.$).find('a').click(function (event) {
    event.preventDefault();
    event.returnValue = false;

    return false;
});

As you can see we’ve been trying some variations for the event cancelation to prevent anchor behaviour. When the element is first created this works as expected. The problem araises when we switch modes in CKEditor.

For those unfamiliar with CKEditor, when you switch modes between “source” and “wysiwyg/design” the iframe that design mode uses is destroyed and replaced with a textarea. When switching back into design, the iframe is recreated and all content populated.

We’ve tried to use this event on CKEditor to reattach the click event, like this:

editor.on('mode', function (e) {
 if (e.data.previousMode == 'source') {
    $jq("iframe").contents().find('.editableArea a').click(AnchorClick);
   }
});

function AnchorClick(event) {
   event.preventDefualt();
   event.originalEvent.preventDefault();
   event.preventPropagation();
   event.returnValue = false;
   return false;
} (this function was separated for debugging purposes)

Again, we tried anything we could think of, but still FF follows the link inside the iframe, which causes the lose of the CKEditor and its contents.

We cannot define href="...” in the anchor tag since the information in the CKEditor is stored for future usage, therefore we must store the true href in the link.

It’s a very peculiar question, I know. The truth is I can’t think of anything else to do and can’t find information about how to overcome FF behaviour in this particular case. Hopefully at least one of the many users of SO has faced a similar issue and can point us in the right direction.

  • 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-01T00:53:54+00:00Added an answer on June 1, 2026 at 12:53 am

    It was a typo. This issue is solved.

    function AnchorClick(event){
    event.preventDefualt();
    ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using CKEditor/CKFinder as wysiwyg editor on my MVC.NET site. I have set
I have an ASP.NET MVC application and I'm using CKEditor for text entry. I
I have a form at which I use ckeditor. This form worked fine at
i have installed ckeditor into my asp.mvc project, now i need to implement just
I have used CKEditor in my ASP.NET pages. But after than, that pages are
I have a CKEditor in my page. Like this <h:head> <title>Facelet Title</title> <script type=text/javascript
I have an instance of CKEditor on a content-editing page. I'm looking to re-use
I have a form where I remove some CKeditor instantiated textareas with jQuery's .remove()
i'v got a trouble, i want to use Ckeditor with my project, i have
I have an instance of CKEditor on a page. I am trying to give

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.