ID:2175554
 
Hi everyone! Me again!

I'm trying to provide a way to call a byond link from a reference stored in javascript to be used with world.location to return information to the Topic proc.

html = {"
<script>
var source_of_ui = \ref
[source_of_ui];
var user_of_ui = \ref
[target_object];
</script>
"}
+ html


I'm adding this to the top of my html file. Looking at the values of source_of_ui and user_of_ui gives me integers in javascript.

I try to use them from within javascript like this:

window.location = 'byond://?src=' + source_of_ui + ";event_type=test_event;target=" + user_of_ui + ";";


However, despite getting no javascript errors, the Topic call on the source_of_ui object is never called. I suspect the url is invalid somehow

Am I missing something somewhere? Do ref values have to be stored as hex strings in javascript and not integers?

Thanks!
A \ref string should be a string in JS too:
    var source_of_ui = "\ref[source_of_ui]";
var user_of_ui = "\ref[target_object]";