question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dynamically added html to code strange behaviour

See original GitHub issue

Hi there,

I want to add an html text to summernote which i got from ajax. The string is like <span style="font-weight: bold;">test</span> test. If I add it like this: $('#product_description_'+lang).code('<span style="font-weight: bold;">test</span> test'); it comments the closing span and adds a closing span to the end. <span style="font-weight: bold;"> test <!-- span--> test</span>

Any idea how i can solve this?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matthboncommented, Jan 4, 2018

Ok got it working now. It had to do with the google translate module which makes a span closing tag like this </ span>. After replacing this for correct closing tag all works.

Thanks for the help 👍

0reactions
DiemenDesigncommented, Jan 4, 2018

All good, glad you found the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Strange behavior with dynamically added content
To do what you require there, add the new div, then prepend the button to it, like this: jsfiddle.net/RoryMcCrossan/u1a5svhx/26. Also note the ...
Read more >
Handling dynamically created HTML in JavaScript - Medium
If you have a JavaScript plugin that needs to keep state, store that state on that element's dataset. Then, in the click handler,...
Read more >
dynamic form and strange behaviour | Javascript
I am generating dynamic forms by overwriting an existing form but I am getting an unexpected behaviour. I have the code like shown...
Read more >
Dynamic List weird behavior with form - Javascript Programming ...
Hi Guys! I ran across a weird behavior and wonder if anyone can tell me what's up with this code for generating a...
Read more >
Handling common HTML and CSS problems - MDN Web Docs
HTML fallback behavior ... Some problems can be solved by just taking advantage of the natural way in which HTML/CSS work. Unrecognized HTML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found