L
laredotornado
Hi,
I'm trying to do something simple that is blowing my mind right now.
I'm on Firefox on Mac 10.6.3. I have this function ...
<script type="text/javascript">
function delete(ruleId) {
if (confirm("Are you sure you want to delete this rule?")) {
location = '/sweeps/delete?id=' + ruleId;
} // if
} // ruleId
</script>
and then I have this link ...
<a href="javascript:var ret = delete(2);">Delete</a>
Clicking on the link does nothing (function isn't invoked and there
are no JS errors in the console). If I take out the "var ret =", the
browser attempts to load the Javascript in the address bar and the
output is "true". What am I doing wrong?
Thanks, - Dave
I'm trying to do something simple that is blowing my mind right now.
I'm on Firefox on Mac 10.6.3. I have this function ...
<script type="text/javascript">
function delete(ruleId) {
if (confirm("Are you sure you want to delete this rule?")) {
location = '/sweeps/delete?id=' + ruleId;
} // if
} // ruleId
</script>
and then I have this link ...
<a href="javascript:var ret = delete(2);">Delete</a>
Clicking on the link does nothing (function isn't invoked and there
are no JS errors in the console). If I take out the "var ret =", the
browser attempts to load the Javascript in the address bar and the
output is "true". What am I doing wrong?
Thanks, - Dave