SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Now available in Orange Tijmen's Avatar
    Join Date
    Jul 2004
    Location
    The Netherlands
    Posts
    1,469
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    missing ) after argument list

    I'm working on a website that has lots of flash animations running on it. And am trying to fix the "Click to activate this content" issue that appeared since SP2 for IE6.

    One of the suggestions from the site of MS is to place the content in a seperate .js file and load it at the location where the flash file should appear. This works just fine for Flash files that don't make use of php to fill in the Flashvars values, if you do try to use that technique with a file that does use php to file in a value i get the following error.

    missing ) after argument list
    gelijkenissen_php... (line 4)
    document.write('<PARAM NAME="FlashVars" VALUE="user_id=<?php echo($_GET['user_id']); ?>&language=nl">');

    The content of the .js file

    Code:
    document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="780" HEIGHT="500">');
    document.write('<PARAM NAME="movie" VALUE="swf/index.swf">');
    document.write('<PARAM NAME="quality" VALUE="high">');
    document.write('<PARAM NAME="FlashVars" VALUE="user_id=<?php echo($_GET['user_id']); ?>&language=nl">');
    document.write('<PARAM NAME="menu" VALUE="false">');
    document.write('<EMBED SRC="swf/index.swf" WIDTH="780" HEIGHT="500" FlashVars="user_id=<?php echo($_GET['user_id']); ?>&language=nl" QUALITY="high" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" TYPE="application/x-shockwave-flash" MENU="false">');
    document.write('</EMBED>'); 
    document.write('</OBJECT>');
    is there any way i can get javascript to parse the php code without the error?
    Travel Photos on Flickr - Twitter

    “Never give up. Never surrender”

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems as if your file is not being run through the PHP parser, so the JavaScript engine is actually seeing your PHP code instead of the generated code.

    The single quotes you use in the PHP statement conflict with the ones surrounding the entire argument to document.write().
    Birnam wood is come to Dunsinane

  3. #3
    Now available in Orange Tijmen's Avatar
    Join Date
    Jul 2004
    Location
    The Netherlands
    Posts
    1,469
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I changed it to $_GET[\'user_id\'], and it works fine now. Thanks
    Travel Photos on Flickr - Twitter

    “Never give up. Never surrender”


Bookmarks

Posting Permissions

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