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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:14:51+00:00 2026-05-31T23:14:51+00:00

I am building an auto-save feature for my TinyMCE editor. With jQuery, I have

  • 0

I am building an auto-save feature for my TinyMCE editor.

With jQuery, I have saved the editor’s content to my database and now want to load the content back in to the editor. I am having troubles with the quotes (“) in the HTML coming from the DB.

My code:

var content = "<%=content%>" // Classic ASP variable containing HTML from DB
tinyMCE.activeEditor.setContent(content);

Example output:

var content = "<p>Oh yes, from Churchill, the <em><span style="text-decoration: underline;"><strong>dog</strong></span></em>.</p>"
tinyMCE.activeEditor.setContent(content);

In the variable, “content”, there are double quotes in the style tag which is causing a JS error. How do I get around this? Do I replace quotes with single quotes or do I use an escape or encode function? Please 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-05-31T23:14:52+00:00Added an answer on May 31, 2026 at 11:14 pm

    VBScript has escaping functionality like Javascript (also ready if you use JScript as default language in classic asp)
    Check out Escape and UnEscape.
    Following is an efficient way of doing to append server-side variables to client-side js block.

    // escape on server-side, unescape with js
    var content = unescape("<%= escape(content) %>");
    tinyMCE.activeEditor.setContent(content);
    

    Example output:

    var content = unescape("%3Cp%3EOh%20yes%2C%20from%20Churchill%2C%20the%20%3Cem%3E%3Cspan%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3Cstrong%3Edog%3C/strong%3E%3C/span%3E%3C/em%3E.%3C/p%3E");
    tinyMCE.activeEditor.setContent(content);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a small webapp for my website and have included tinyMCE as
I'm working on building a MySQL database that will have many related tables. I
Building a new Mobile Web Platform for Mobile Users to purchase & download content
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
Basically I am building an auto Awards system for users of my forum. What
I'm building some Word 2003 macro that have to be put in the %APPDATA%\Microsoft\Word\Startup
We are building a web app which will have a lot of images being
I am building an auto-complete like script for text inputs. In order to avoid
I'm building a webapp that allows users to create, edit, and save documents. The
I'm building an iPhone game that uses Game Center to auto-connect random players looking

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.