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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:51:45+00:00 2026-05-26T20:51:45+00:00

I am trying to embed a flash movie on a webpage through AJAX using

  • 0

I am trying to embed a flash movie on a webpage through AJAX using jQuery. The flash movie takes in several commands from the querystring.

Thru an AJAX command jQuery returns HTML code that embeds the flash movie, this code has & in the querystring which then get converted to & – this breaks the code and stops the flash movie from being displayed. The dataType is “text”, not “html” in the ajax call.

Ive search around and seen a few people have suffered with this problem. Apparently the main problem is that using .html() or .append() to insert code into a webpage automatically converts & to & – Id like to be able to insert code without this happening. However Id settle for simply converting them back again (which seems to be the main solution to the problem Ive seen), but this isnt working for me at all.

I am running this bit of code to replace all the & with &:

$(target+' embed').attr('src',function(){
  var currentHref=$(this).attr('src');
  var newHref=currentHref.replace(/amp;/ig,'');
  return newHref;
});

Where target is the Id of the container div the flash movie is in. This code doesnt find any & – but when I view the source the & are still present and the flash movie is still not working.

Id love to be able to insert code without this & to & conversion happening. Can this be done with jQuery? Failing that, how can I get this bit of code to replace all the & with &?

Sorry for the long question and TIA.

  • 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-26T20:51:45+00:00Added an answer on May 26, 2026 at 8:51 pm

    A bare, unescaped & is simply invalid HTML. There is no reason ever to include one in markup.

    Any browser, when it sees a & that is not part of an entity reference, will fix it up for you to correct your mistake. This happens at parse time, either when loading the document, or on setting innerHTML as html() and append() do.

    The browser does not remember your original markup, but only a set of objects and properties (the ‘DOM’) that reflects the current state of the page. These objects are populated by parsing your input HTML, but if you fetch markup by reading innerHTML or html() you will get a freshly-serialised set of markup created from the DOM objects and not the markup you originally put in. You will see differences in whitespace, attribute order, and any mistakes in the original markup will be fixed.

    When you interact with the document from script, on the level of properties, attr() or text(), you’re going directly to the DOM without asking it to serialise the information it has back into HTML markup. In that case you will get on-page ampersands as simple &, not escaped. So naturally in this case your regexp will not find any to replace; there is simply no ‘underlying markup’ for you to make edits to.

    So the real question is really, what string are you ending up with that is ‘making the code fail’, and how is that being handled? This isn’t visible in the posted question.

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

Sidebar

Related Questions

I am trying to embed a flash movie (.flv) into a webpage with a
Trying to embed Flash into a HTML page using FBML tag fb:swf and I
I am trying to embed a flash movie into a facebook (iframe) canvas. When
Im trying to load a flash movie using swfobject which i have been successful
I am trying to fade out a Flash embed object and fade in regular
Im trying to put an html embed code for a flash video into the
I'm trying to embed a IPTC data onto a JPEG image using iptcembed() but
I am trying to embed multiple external websites into one web page. Using an
I'm trying to embed a window from my process into the window of an
I am trying to embed swf to html, and I'm using SwfObject 2.0 My

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.