PHP js函数onmouse =“抛出错误未捕获语法}

时间:2017-09-27 01:22:37

标签: javascript php syntax

这是代码

<video title='{$row['title']} {$row['locate']}' 
   class='vidscrollclass' 
   style='position:absolute; top:0%; left:0%; width:100%; height:100%; transform: scale(1.0,1.1); z-index:103;' no-controls  
   preload='metadata' 
   ondblclick='
      document.getElementById([$vid]).submit(); 
      return false;' 
   onmouseover='
      document.getElementById([$vid]).addEventListener('touchstart', tapHandler); 
        var tapedTwice = false; 
        function tapHandler(event){
          if(!tapedTwice) { 
             tapedTwice = true; 
             setTimeout( function() { tapedTwice = false; }, 300 ); 
                 return false;
          }
          document.getElementById([$vid]).submit(); 
          return false;
        }'
>

由于某种原因,它不断抛出相同的错误。 iv检查语法,一切都井然有序。 php中使用相同的功能。但是在php中它会抛出错误

未捕获的SyntaxError:意外的令牌}

如果有人能看出问题所在,我将非常感谢您的意见。

1 个答案:

答案 0 :(得分:0)

echo"                                      

            <div style='position:absolute; top:5%; left:{$x}%; width:20%; height:95%; z-index:100;' >


<img src='videobak.png' style='position:absolute; top:-30%; left:-30%; width:170%; height:162%; z-index:101; '>


            <div style='position:absolute; top:5%; left:-15%; width:125%; height:80%; border-style: ridge; 5vw; border-color:{$c}; border-radius: 5vw; background-color:black; overflow:hidden; z-index:102;'>


            <img id='waiter' class='loaderlogo' src='loadinglogo.png' >


                     <video id='$vidd' title='{$row['title']} {$row['locate']}' class='vidscrollclass' style='position:absolute; top:0%; left:0%; width:100%; height:100%; transform: scale(1.0,1.1); z-index:103;' no-controls  preload='metadata' onmouseover='tr($vidd , $vid);' ondblclick='document.getElementById([$vid]).submit(); return false;' > 


                     <source src='vid/{$genre}/{$row['videos']}' type='video/mp4' >
                      <source src='vid/{$genre}/{$row['videos']}' type='video/mp4' >
                       <source src='vid/{$genre}/{$row['videos']}' type='video/mp4' >


                       <div style='position:absolute;top:4%; left:4%; width:94%;height:94%;color:white; background-color:red;'><marquee WIDTH=500 HEIGHT=20>---Your browser does not support the video player --Either update your plugins or browser or for best results USE CHROME - CHROMIUM - CHROME CANARY or FIRE FOX BROWSERS for compatibilty assurance---</marquee></div>


                     </video >


        <form id='$vid' action='mainpagesalesvidsphp.php' target='YTiframe' method='POST' enctype='multipart/form-data';>

        <input id='val1' type='hidden' type='text' name='video' value='{$vid}' >

         <input id='val2' type='hidden' type='text' name='genre' value='{$genre}' >

        <input id='val3' type='hidden' type='text' name='search' value='{$search}' >

        <input type='hidden' type='submit' value='POST'>

        </form>

    </div> 

</div>";
$x=$x+33;

}
$wid=$x; //might need ammending according to math...
?>

<script>

function tr(e , f){
    console.log('yup recieve',e , f)
document.getElementById(e).addEventListener("touchstart", tapHandler); var tapedTwice = false;
  function tapHandler(event) {if(!tapedTwice) {tapedTwice = true;setTimeout( function() { tapedTwice = false; }, 300 );return false;}
  how();

  function how(){
      console.log('sending to',f)
  document.getElementById(f).submit(); return false;} 

  }; 

};
</script>