ID:134407
 
I was hoping that the BYOND Developers could add a similar activeX object to Mircosoft.XMLHTTP. This would then alow pop-ups to send stuff over and dynamicly updating without a forced refesh!

example type code:

mob
verb
test()
src << browse({"
<html>
<head>
<script language="javascript">
function loadurl(dest)
{
try
{
xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
new ActiveXObject("Microsoft.XMLHTTP"); //BROKEN LINE OF CODE THAT DOESN'T WORK WITH BYOND
//new ActiveXObject("BYOND.request"); //New proposed object
}
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";


}
</script>
</head>
<body>
<div id="output">
click here to load my resume into this div

<a href="#" onclick="javascript:loadurl('?src=\ref
[src];action=refresh');">test 1</a><br>
<a href="?src=\ref
[src];action=refresh">test 2</a>
</div>
No more div
</body>
</html>

"}
,"window=popup")


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

return
else ..()


datum/proc
refresh()
return {"TESTING"}
I managed to pull off a similar process. AJAX, javascript that reads off an html or text file loaded into the resource (that can then be reloaded with new content by DS and read again by the JS)... a little hacky and not ideal, but it works.
Zjm7891 wrote:
I was hoping that the BYOND Developers could add a similar activeX object to Mircosoft.XMLHTTP. This would then alow pop-ups to send stuff over and dynamicly updating without a forced refesh!

Since the mini-browser does not strictly use the HTTP protocol to contact BYOND, what you're asking is not possible. You're looking at the browser-BYOND communication process from the wrong perspective; it does not work like loading a Web page.

Lummox JR
In response to Lummox JR
I know.. Thats why I was thinking about using an ActiveX object built by BYOND.


BYOND.REQUEST or something...

I know they have excel.application so I don't know why it would be impossible todo sucha thing with byond.
In response to Zjm7891
It's not impossible, but it's not a valid use of the BYOND developer's time, they have much more important features to deal with.
In response to Zjm7891
Zjm7891 wrote:
I know.. Thats why I was thinking about using an ActiveX object built by BYOND.

BYOND.REQUEST or something...

I know they have excel.application so I don't know why it would be impossible todo sucha thing with byond.

Maybe not impossible, but utterly pointless. Mind you most of the apps that work that way are Microsoft apps anyway. Just find another way to do what you wanted to do.

Lummox JR
In response to Lummox JR
Pointless!?

Not pointless at all!
Have you played a game where you wanted to update an HTML pop-up window but didn't want to remove focus from the player and what they were doing?

I happen to want to try that alot, it never works because whenever I update the window, focus is pulled from whatever I'm doing!

For example, I want to create a window to moniter a scanner. The scanner is scanning for ships in the "galaxy". Every time it finds one I want to update that window, however, if I update the window, I lose focus from whatever I may be doing such as typing in the pink bar.
In response to Zjm7891
I believe there is a Javascript method or something to make it stop losing focus. (hub://Shadowdarke.sd_Alert does this)