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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:54:53+00:00 2026-05-12T19:54:53+00:00

I have a plain html web page with an embedded flash object. Based on

  • 0

I have a plain html web page with an embedded flash object. Based on presence of a query string, I want to vary one of the paramters to the object, so I wrote something like this:

<object  ...>
   <param ...>
   <param ...>
   <script type="text/javascript">
      if (window.location.search.indexOf("stuff")>=0) {
          document.write("<param  variant 1>");
      } else {
          document.write("<param variant 2>");
      }
   </script>
</object>

It works great in Firefox, but IE8 does not execute the js code, at all. I replaced the entire script with a simple alert(“a”) call, and that was not executed by IE8, either. Using the developer tool, I can see the script, but it’s not highlighted, nor can I set a breakpoint in it, so I’m pretty sure it’s not acknowledging it as a valid script.

Is this an IE restriction, or am I missing something?

I’ve replaced the whole with document.write calls, and that works fine, but I’d prefer something closer to my original attempt.

  • 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-12T19:54:53+00:00Added an answer on May 12, 2026 at 7:54 pm

    I think the problem lies in the DOM and with Internet Explorer seemingly not executing in-line JavaScipt.

    Waiting for the window to load before initialising, and then adding the parameters as children (rather than writing HTML) is the proper way to go, it seems.

    The following worked as expected in both Firefox and Internet Explorer.

    <html>
    <head>
        <script type="text/javascript">
    
            listen(window, "load", "onload", initiate);
    
            // called when the window finishes loading
            function initiate() {
                checkStuff();
            }
    
            function checkStuff() {
    
                var myObj = document.getElementById("myObj");
                var elm = document.createElement('param');
    
                if (window.location.search.indexOf("stuff") >= 0){
                    elm.setAttribute("name", "param1");
                    elm.setAttribute("value", "true");
                } else {
                    elm.setAttribute("name", "param2");
                    elm.setAttribute("value", "true");
                }
    
                myObj.appendChild(elm);
            }
    
            // just a simple function to attach events to objects
            function listen(obj, event_normal, event_alt, func) {
                if (obj.attachEvent) {
                    obj.attachEvent(event_alt, func);
                } else if (obj.addEventListener) {
                    obj.addEventListener(event_normal, func, false);
                } else {
                    obj.addEventListener(event_normal, func, false);
                }
            }
    
        </script>
    </head>
    <body>
        <object id="myObj"></object>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 226k
  • Answers 226k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer WPF mitigates this problem by introducing Routed Events. At any… May 13, 2026 at 1:12 am
  • Editorial Team
    Editorial Team added an answer $(".first").addClass("second"); If you'd like to add it on an event,… May 13, 2026 at 1:12 am
  • Editorial Team
    Editorial Team added an answer I tried the first example and PyLint 0.18.1 gave me… May 13, 2026 at 1:11 am

Related Questions

In my Apache webserver I put this: <Directory /var/www/MYDOMAIN.com/htdocs> SetHandler mod_python PythonHandler mod_python.publisher PythonDebug
I have an internal web app with an image at the top of the
I have a project with two silverlight apps (foo1 and foo2) and an ASP.NET
This is somewhat of a follow-up to an answer here . I have a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.