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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:32:54+00:00 2026-05-24T22:32:54+00:00

I am trying to debug this (incomplete) script, but it is behaving inconsistently. The

  • 0

I am trying to debug this (incomplete) script, but it is behaving inconsistently. The main problem is when I click off of an item, sometimes the $(editObj).removeAttr('style'); runs and sometimes not. Through the Chrome inspector I can see that the editObj variable in each case is properly defined, but it isn’t always getting its inline style attribute removed. Sometimes, and sometimes not. Cannot determine the reason.

I’m a bit out of my element with this code. Maybe something about it is obvious; Regardless I’d appreciate some ideas on why this sort of unpredictable might be occuring!

    var editObj = null;
    var inputType = 'text';
    var input = '#textEdit';
    var formId = '#form_undefined'

$(function() {
$("#textEdit").click(function(event) {
        event.stopPropagation();
    });

    $('body').click(function(event) {
        if (editObj){


            //textedit contents to editobj and 
            if (inputType == 'text'){
                $(editObj).text($("#textEdit").val());
            }
            $("#textEdit").removeAttr('style').hide();

            $(editObj).removeAttr('style');
            var previewId = $(editObj).attr('id');
            var formId = previewId.replace('bzm', 'form');
            $("#" + formId).val($("#textEdit").val());

            //ajax modify database
            editObj = null;
        }
    });

    $(".editable").not("video, img, textarea")
    .click(function(event) {
        event.stopPropagation();
        loadEditor($(this));
    });
});

function loadEditor(element){

    $("#textEdit")
        .copyCSS(element)
        .offset($(element).offset())
        .css("display", "block")
        .val($(element).text())
        .select();

    $(element).css("color", "transparent");

    editObj = element;
}
  • 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-05-24T22:32:55+00:00Added an answer on May 24, 2026 at 10:32 pm

    I’ve had trouble in the past with .removeAttr('style'); not actually removing all the inline styles.

    Use

    $(editObj).attr('style', '');
    

    instead of

    $(editObj).removeAttr('style');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to debug this problem for many hours, but to no avail.
I am having trouble trying to get this script to work. When I debug
I've been trying to debug this for an hour: <script type=text/javascript> function initialize() {
Ive been trying to debug this for hours but I was unable to get
I've been trying to debug this issue for hours upon hours but with no
So I'm trying to debug this strange problem where a process ends without calling
I am trying to debug this piece of code: $(document).track( { 'module' : 'Omniture',
I have this output when trying to debug Program received signal SIGSEGV, Segmentation fault
I am trying to debug a segfault, and I have this output from gdb:
I am trying to debug a problem wherein RedirectToAction appears to be working properly

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.