admin管理员组文章数量:1403348
i have this javascript:
<SCRIPT LANGUAGE="JavaScript">
<!--
// Generated at .html
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=400,left = 283,top = -16');");
}
// -->
</script>
i want to use an href with a javascript popup function but its not working. here is my code
<?php
echo "<a href = '#' onClick='javascript:popUp('editdelete.php?emoticon_text=$emoticon_text&id=$id')'><img src='update.png'></a>";
?>
but its not working
(the $emoticon_text and the $id will be passed to the pop up window using $_GET function.)
thanks
i have this javascript:
<SCRIPT LANGUAGE="JavaScript">
<!--
// Generated at http://www.csgnetwork./puhtmlwincodegen.html
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=400,left = 283,top = -16');");
}
// -->
</script>
i want to use an href with a javascript popup function but its not working. here is my code
<?php
echo "<a href = '#' onClick='javascript:popUp('editdelete.php?emoticon_text=$emoticon_text&id=$id')'><img src='update.png'></a>";
?>
but its not working
(the $emoticon_text and the $id will be passed to the pop up window using $_GET function.)
thanks
Share Improve this question edited Jul 30, 2013 at 5:31 Christian Burgos asked Jul 30, 2013 at 5:22 Christian BurgosChristian Burgos 1,5919 gold badges28 silver badges50 bronze badges2 Answers
Reset to default 2You are mixing your quotes usage. Please try the following:
<a href = '#' onClick='javascript:popUp("editdelete.php?emoticon_text=$emoticon_text&id=$id")'><img src='update.png'></a>
Note the double quotes inside javascript:popUp
inplace of single quote as you have in your question.
Update:
After OP's ment below:
<?php echo "<a href = '#' onClick='javascript:popUp(\'editdelete.php?emoticon_text=$emoticon_text&id=$id\')'><img src='update.png'></a>"; ?>
<a href = '#' onClick='javascript:popUp('editdelete.php?emoticon_text=$emoticon_text&id=$id')'><img src='update.png'></a>
should be
<a href = '#' onClick="javascript:popUp('editdelete.php?emoticon_text=<?php echo $emoticon_text; ?>&id=<?php echo $id; ?>')"><img src='update.png'></a>
本文标签: phphref with onclick javascript popupStack Overflow
版权声明:本文标题:php - href with onclick javascript pop-up - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744386139a2603747.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论