ID:144764
 
Code:
mob
verb
test()
src << browse({"
<html>
<head>
<script language="javascript">
function loadurl(dest)
{
try
{
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) { /* do nothing */ }
xmlhttp.onreadystatechange = triggered;
xmlhttp.open("GET", dest);
xmlhttp.send(null);
}


function triggered()
{
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
document.getElementById("output").innerHTML =xmlhttp.responseText;
else
document.getElementById("output").innerHTML ="ERROR IN TRANSFER";


}
function test()
{
setTimeout("loadurl('?src=\ref
[src];action=refresh')",100);
}
</script>
</head>
<body>
<div id="output">
click here to load my resume into this div
<a href=javascript:loadurl('byond://?src=\ref
[src];action=refresh');>test 1</a><br>
<a href="?src=\ref
[src];action=refresh">test 2</a>
</div>
</body>
</html>

"}
,"window=popup")


mob/Topic(href,href_list[])
if(href_list["action"] == "refresh")
world <<"BLAH"
return src.refresh()
else ..()


datum/proc
refresh()
return {"TESTING"}


Problem description:
Thats the whole project, now if I set the URL to try to open to be something like www.google.com it works... or if I click test 2 it works... but when I try the test 1 link it does not. Do you know of any reason for this?
Try changing your datum/Topic() to simply mob/Topic() I've never seen any instance where you'd need to define it under atom or datum.
In response to Nadrew
Actually I will have to do that later because of the way I'll be using that, however, that still does not fix the problem. The problem is somewhere in the transfering of the URL
In response to Zjm7891
A guess would be that DHTML's HTTP functions don't support destinations without a protocol, try changing the link from '?blahblah' to 'byond://?blahblah'.
In response to Nadrew
I've tried that(as you can see in the updated code) it still doesn't seem to be working.

I think this might be a bug in BYOND itself and its IE integration
In response to Zjm7891
Chances are the HTTP functions only accept HTTP links, seems pretty logical to me. The browser itself is all IE, there's not much on BYOND's end for it except putting it in the window, it does all of the parsing and whatnot.
In response to Nadrew
In response to Zjm7891
Not quite, the 'test 2' link is a direct link to Topic() without using your Javascript, when you're passing your Topic() link through your Javascript it chokes at the xml HTTP stuff because the link being sent isn't a HTTP link, and if you think there's a good chance it only accepts HTTP links (which is why valid HTTP links like Google work).