I\’ll show the main parts of the code as most of it is irrelevant:
$url = $row[\'url\'];
echo \"<div id=\'anything\'><img id=\'$url\' src=\'$cover\' alt=\'$title\' onclick=\'myFunction($url)\'>\";
and the javascript function:
function myFunction(something) {
alert (something);
}
I recieve the following error in firebug:
missing ) after argument list
[Break On This Error]
myFunction(http://anything.com/anything...
-------------------^
I am relatively new to javascript but I can tell it is obviously not allowing the \”:\” from the url. However, I can\’t change or alter the id, as I need to alert the exact id of the Image.
I have made this work in a different format without the php, so I assume it\’s there where the problem lies?





Rating:
The post php – missing ) after argument list appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/php-missing-after-argument-list.html
No comments:
Post a Comment