dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Help with (simple?) Syntax Error

  1. #1
    Join Date
    Jan 2013
    Posts
    2

    Help with (simple?) Syntax Error

    Hello-

    I am using Flash, and am using an else/if statement to substitute content if the user's browser does not have Flash. I am having an issue with the Syntax, and I can't figure out how to fix it, any help would be greatly appreciated! Thanks! I'm not an HTML expert...

    I want to add the code as an alternative content:

    <div id="swiffycontainer" style="width: 950px; height: 480px">
    </div>
    <script>

    var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
    swiffyobject);

    stage.start();
    </script>

    I want to add this above code into the HTML below:

    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'I WANT TO PUT THE ABOVE CODE HERE'
    + '';
    document.write(alternateContent); // insert non-flash content
    }

    But, when I add this code, I am getting a syntax error on the second line starting with "var alternateContent"

    How can I correct?

    Here is the code with the syntax error:

    } else { // flash is too old or we can't detect the plugin
    var alternateContent = '<div id="swiffycontainer" style="width: 950px; height: 480px">
    </div>
    <script>

    var stage = new swiffy.Stage(document.getElementById('swiffycontainer'),
    swiffyobject);

    stage.start();
    </script>'
    + '';
    document.write(alternateContent); // insert non-flash content
    }
    }

  2. #2
    Join Date
    Jan 2013
    Posts
    2
    Here is the page that has the syntax error and is not working properly. Basically, I am using a substitute for Flash (with HTML5) if the browser doesn't have the Flash plugin.

    http://sweetpea-flowers.com/swiffy.htm

    Thanks in advance for any help/advice!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles