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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:54:28+00:00 2026-06-09T11:54:28+00:00

I am trying to display some html embedding a SWF object using javascript. The

  • 0

I am trying to display some html embedding a SWF object using javascript.

The script works fine without the SWF object. Howevever, when the object is included in the html inserted into the div the script no longer runs.

If anyone can suggest fix or spot error, I would greatly appreciate it.

Here is jsfiddle.

http://jsfiddle.net/UJpQ4/

Code (same as jsfiddle):

html:

<a href="javascript:void(0)" onclick="takeProfilePic('0');">Show Flash</a>
<a href="javascript:void(0)" onclick="takeProfilePic('1');">Do not show flash</a>
<tr><td colspan=2 align="center"><div id="takepic"></div>

javascript:

function takeProfilePic(type) {
//   alert(type);
if (type==0)
  {
   var target = 'takepic';
   var photo = '<tr><td colspan=2 align="center">hello</td></tr>';
document.getElementById(target).innerHTML = photo;
return false;
  }
    else if (type==1) {
        var target = 'takepic';
   var photo = '<tr><td colspan=2 align="center"><a href="stepthree.php"><img src="images/collapse.gif" border=0></a></td></tr><tr><td colspan=2 align="center">NO FLASH OBJECT HERE</td></tr>';
  document.getElementById(target).innerHTML = photo;
return false;      
    }     
}
  • 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-09T11:54:29+00:00Added an answer on June 9, 2026 at 11:54 am

    Use EMBED tag instead of OBJECT tag.

    function takeProfilePic(type) {
    //   alert(type);
    if (type==0)
      {
       var target = 'takepic';
       var photo = '<tr><td colspan=2 align="center"><a href="stepthree.php"><img src="images/collapse.gif" border=0></a></td></tr><tr><td colspan=2 align="center"><div id="piccontent"><embed src="file.swf" type="application/x-shockwave-flash" width="520" height="400" /></div></td></tr>';
       document.getElementById(target).innerHTML = photo;
       return false;
      }
      else if (type==1) {
       var target = 'takepic';
       var photo = '<tr><td colspan=2 align="center"><a href="stepthree.php"><img src="images/collapse.gif" border=0></a></td></tr><tr><td colspan=2 align="center"><div id="piccontent">NO FLASH OBJECT HERE</div></td></tr>';
       document.getElementById(target).innerHTML = photo;
       return false;      
      }     
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to display some JavaScript variable on my HTML page. I was
Greetings! I've been trying to display some HTML with Java using JEditorPane . But
I'm trying to display some large images with HTML img tags. At the moment
I'm trying to display some data from a list sharepoint and then using jquery
I'm trying to display a specific block of html with some form elements based
I'm trying to learn some html/css/javascript, so I'm writing myself a teaching project. The
I'm trying to parse some HTML using DOMDocument, but when I do, I suddenly
I'm trying to select a nested table to display some tabular data using jQuery
I'm trying to display some HTML files that have code samples, surrounded by codeblock
I am trying to use a WebGrid to display some data, this is fine

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.