balkan7 Posted February 27, 2009 Share Posted February 27, 2009 this function i use for YouTube videos only works in FF and IE shows me the errors and not to open the popup, how can I fix this error. <?php function displayVideos($Videos, $maxVideos=NULL,$columns=4,$rows=NULL){ global $locale; // Popup echo "<script type='text/javascript'> function open(url, title,w,h) { var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); var targetWin = window.open (url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); } </script>"; // End if($maxVideos==Null){ $maxVideos=count($Videos); } if(!is_int($maxVideos)){ trigger_error("Maximum number of videos to show must be an integer, not ".$maxVideos,E_USER_WARNING); return 1; } if($rows==NULL){ $rows=ceil($maxVideos/$columns); } echo '<table align="center" width="100%" border="0" cellspacing="5" cellpadding="5" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">'; $i = 0; //print_r($Videos[0]); $video=$Videos[$i]; for($r=0; $r < $rows; $r++) { $video=$Videos[$i]; echo '<tr>'; for($c=0; $c < $columns; $c++) { echo '<td valign="top" width="130">'; if($i < $maxVideos && $Videos[$i]){ $video=$Videos[$i]; if (isset($_GET['s']) == "mr") { echo "<a href=\"javascript: void(0);\" onClick=\"open('pogledni.php?video=".$video->url."', '".$video->title."', '620', '480');\"><img src='http://i.ytimg.com/vi/".$video->url."/default.jpg' border='0' width='130' height='97' /><br />".$video->title."</a><br />".$locale['yt-012']." ".$video->postdate."<br />".$locale['yt-013']." ".$video->views.""; } else { echo "<a href=\"javascript: void(0);\" onClick=\"open('pogledni.php?video=".$video->url."', '".$video->title."', '620', '480');\"><img src='http://i.ytimg.com/vi/".$video->url."/default.jpg' border='0' width='130' height='97' /><br />".$video->title."</a><br />".$locale['yt-012']." ".$video->postdate."<br />".$locale['yt-013']." ".$video->views."<br />"; if ($video->star1!=""){ echo $locale['yt-014'].'<img src="'.$video->star1.'" /><img src="'.$video->star2.'" /><img src="'.$video->star3.'" /><img src="'.$video->star4.'" /><img src="'.$video->star5.'" />'; } else{ echo '<br/>'; } echo '<br /> '; } } echo '</td>'; $i++; } } echo '</table><div align="right" style="padding-right: 25px">'; } ?> Link to comment https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/ Share on other sites More sharing options...
samshel Posted February 27, 2009 Share Posted February 27, 2009 this is a JS problem..please post in appropriate forum. Link to comment https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/#findComment-772860 Share on other sites More sharing options...
balkan7 Posted February 27, 2009 Author Share Posted February 27, 2009 I use different JS Popup codes, again the same result simply will not open popup in IE, FF on working perfectly. Link to comment https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/#findComment-772865 Share on other sites More sharing options...
samshel Posted February 27, 2009 Share Posted February 27, 2009 what is the JS error is it showing? Link to comment https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/#findComment-772867 Share on other sites More sharing options...
balkan7 Posted February 27, 2009 Author Share Posted February 27, 2009 I get this error Line: 414 Char: 8 Error: Invalid argument. Code: 0 URL: www.myurl.com Link to comment https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/#findComment-772872 Share on other sites More sharing options...
samshel Posted February 27, 2009 Share Posted February 27, 2009 works for me if i hard code the variables. means there may be a problem with URL.. please view source ur page in IE and post the the part with a href and img Link to comment https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/#findComment-772874 Share on other sites More sharing options...
balkan7 Posted February 27, 2009 Author Share Posted February 27, 2009 Ok this is web site: http://labunista.nxserve.net/video/index.php Try clicking more video links. Link to comment https://forums.phpfreaks.com/topic/147222-function-not-working-on-ie/#findComment-772875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.