When using
href="javascript:functionName();"
onclick="functionName(); return false;"
Numbered Steps to Reproduce Problem:
- Click the problem link that calls the JS function
- Observe that Topic no longer functions for that object
Code Snippet (if applicable) to Reproduce Problem:
/client
show_map = 0
/client/verb/test_case()
var/html= {"
<html>
<head>
<title>Test JS Function</title>
<script>
function testFunction() {
alert('JavaScript function called successfully!');
}
</script>
</head>
<body>
<h2>Call Test JavaScript Function</h2>
<!-- Link using href with javascript: -->
<a href="javascript:testFunction();">I break Topic! (in 515.1638 and newer)</a><br>
<!-- Link using onclick attribute -->
<a href="#" onclick="testFunction(); return false;">I don't break Topic!</a>
<h2>Call Topic</h2>
<a href='?src=\ref[src];action=test_case'>Topic Call Test</a>
</body>
</html>
"}
usr << browse(html, "window=test_case")
/client/Topic(href, href_list)
switch(href_list["action"])
if ("test_case")
alert(usr, "Topic is working")
Expected Results:
Clicking a link generates Topic calls
Actual Results:
Clicking a link using the
href="javascript:function();"
Does the problem occur:
- Every time? Or how often? Every time.
- In other games? Yes.
- In other user accounts? Yes.
- On other computers? Yes.
When does the problem NOT occur?
The problem does not occur when using the
onclick='function(); return false'
href="javascript:function();"
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
The last working version was 515.1637.
Workarounds:
- Use the
onclick
href="javascript:function();"
- Have players downgrade to 515.1637