I have a weird issue with a javascript script that won't run inside my php echo. The script shows in the source page but doesn't run. My file is in a iframe (facebook app), I am using firefox and firebug.
I have a function returning my script as a string, and then I echo this function.
function myFunction($request_token){
if ($count == 0){
return "<script>console.log(\"run??\");</script><a href=\"blabla\"></a>";
}
}
When I look at the source code I see
<script>
console.log("run??");
</script>
<a href="blabla"></a>
which seems fine, but nothing shows up in the console. I tried to do an alert, won't work either.
Does somebody have an idea?
<script type="text/javascript">. Do you have any other scripts on the page that might throw errors? (scripts are executed in serial, if one throws you're done).