1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Javascript in innerHTML, any examples?

Discussion in 'JavaScript' started by 123GoToAndPlay, Mar 28, 2007.

  1. #1
    Hi all,

    I am having problems with displaying flash content in an Ajax div.

    Normally it would be something like this (flashcontent.php)
    
    <div id="flashContent">No flash player</div>
    <script type="text/javascript">
       var so = new SWFObject("myFlash.swf", "myFlash", "750", "300", "7", "FFFFFF");
       so.write("flashContent");
    </script>
    
    Code (markup):
    this works

    Now I make an ajax request
    
    <div id="content"></div>
    
    <a href="javascript:makeRequest('flashcontent.php','content')">test flashcontent in ajax div</a>
    
    Code (markup):
    somehow the div flashcontent isn't being replaced by the swf???

    I would like to see some examples, where you have working javascript in the div's innerhtml???

    tx in advance
     
    123GoToAndPlay, Mar 28, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    I'm guessing this.
    
    javascript:makeRequest('flashcontent.php','[b]content[/b]')
    
    Code (markup):
    Should be the ID of the response object. Which looks like it'd be flashContent.
    
    <div id="[b]flashContent[/b]">No flash player</div>
    
    Code (markup):
    Just a guess though, since you're not posting your code...
     
    nico_swd, Mar 29, 2007 IP