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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:15:01+00:00 2026-06-04T22:15:01+00:00

Good Afternoon people, i am working with CKEDITOR and JQuery i need know how

  • 0

Good Afternoon people,

i am working with CKEDITOR and JQuery i need know how when i load a html info CKEDITOR move the editor to an anchor into html.

for example:

i was loaded an URL data like:

http://example.com/Books/newbook/html/Text/CR!SZ3H2DP1BD2MFEK9AMDKXC1TEQZT_split_011.html

i need that the editor show to me the content pointing to #filepos91625 anchor section.

this is part of my code:

var editor = $('#xhtml').ckeditorGet();
editor.config.baseHref = response.css;
var url = response.path + block;
editor.setData(response.content);

/* I NEED HERE CODE TO POINT TO ESPECIFIC ANCHOR SECTION INTO HTML EDITOR */ 

thanks so much, i really appreciate the help

  • 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-04T22:15:03+00:00Added an answer on June 4, 2026 at 10:15 pm

    Assuming you have something like this:

    <textarea cols="80" id="xhtml" rows="10">
    <a href="#l001">Line 1</a><br />
    <a href="#l002">Line 2</a><br />
    <a href="index.html#filepos91625">Line 3</a><br />
        ...
    <a href="#l038">Line 38</a><br />
    </textarea>
    

    and you want ckeditor to go to href containing “#filepos91625”, use the following code:

    $('#xhtml').ckeditor( function() { 
                var tags = document.getElementById('cke_contents_xhtml').firstChild.contentWindow.document.getElementsByTagName("a");
                for (var i = 0; i < tags.length; i++)
                {
                    if (tags[i].href.indexOf('#filepos91625')!=-1) {
                                    document.getElementById('cke_contents_xhtml').firstChild.contentWindow.scrollTo(0, tags[i].offsetTop);
                    }
                }
    
                } );
    

    This is a mix between jquery and normal javascript, but it should work this way – jquery cannot be used inside the iframe anyway.The callback handler of CKEDITOR iterates over the href elements and looks for a link with the hashtag #filepos91625, and when it gets found scrolls to the offset position of the tag inside the iframe.

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

Sidebar

Related Questions

Good afternoon people's I have built a jquery plugin that I use on my
Good afternoon, I've run into some issues trying to combine HTTP caching with Rack::Cache
Good afternoon, I'm working on a project for my company to run an update
Good afternoon, I'm having a problem with a section of code I'm working on
Good afternoon, does anyone know of a library that would allow me to read
Good afternoon, I need to be able to search a Lucene.Net index with a
Good Afternoon, I have a html aspx page that has many many div elements.
Good afternoon fellows, I'm having trouble with some jQuery-code and I can't seem to
Good afternoon, OK, short and sweet. I need to get the number of bytes
Good Afternoon, everyone. I have an ongoing issue with the code below. I know

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.