[thelist] RE: Remote Scripting

Siri Atma Oaklander De Licori saodl at yahoo.com
Mon Nov 17 14:59:24 CST 2003


Hi.

I've been struggling with the same problem.  I came
across the following in my research a while ago.  I
don't have the link anymore, but you should be able to
find more info.  I have not tested it myself, as I am
currently prototyping offline and this technique
doesn't work there for security reasons.  Therefore
I'm still using iFrames...:(.  If this works for you,
please let me know as I'll probably be switching over
before too long.

siri

---- excerpt below ----

You can use this script to bring external include
files into a layer in the page:

<script language='JavaScript'>
<!--
function include(lyr,url)
{
  if (document.all)
  {
     // IE version
     var xml = new ActiveXObject("Microsoft.XMLHTTP");
     xml.Open( "GET", url, false );
     xml.Send()
    
document.getElementById(lyr).innerHTML=xml.responseText;
  }
  else
  {
     // Mozilla/Netscrap 6+ version
           var xml=new XMLHttpRequest();
           xml.open("GET",url,false);
           xml.send(null);
          
document.getElementById(lyr).innerHTML=xml.responseText;
  }
}
//-->
</script>
You can trigger the script off the load:
<body
onLoad="include('somediv','http://somepath/somefile.html'">
where somediv looks like: <div
id="somediv">&nbsp;</div>

or inline as a conventional include:

<script language='JavaScript'>
  document.write('<div id="somediv">&nbsp;</div>');
  include('somediv','http://somepath/somefile.html');
</script>

If the string returned from the call contains valid
HTML it will be rendered, otherwise it will display as
plain text.

Does not work for older browser like Netscrap 4.x that
do not know what XML is.

It can produce an alert if the user security settings
have activeX disabled.

To test it you have to go through a server is will not
work locally using a file: protocol

------- Hershel Wrote ------

I am interested in learning more about Remote
Scripting. I have always
updated web pages dynamically via what is known as
'hidden CGI' using 
an
IFRAME. I also update the server this way (with new
data) without 
changing
the web page.

I understand that Remote Scripting can make this
process smoother and
perhaps more automated and transparent to the user. I
also understand 
that
it is inherently ASP-based. I am working on an
IE6-only site and a 
Windows
server so MS issues should not present any problems.

Can anyone confirm or deny the above and either way,
can anyone point 
me in
the direction of a good introduction (a URL) to this
technology?

Thanks,
Hershel


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


More information about the thelist mailing list