Applying background dynamically from ajax [ iframe issue ]

August 6, 2007 at 8:51 am Leave a comment

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<script type=”text/javascript” language=”javascript”>
var http_request = false;

  function makeRequest(url,id) {

   try {
    netscape.security.PrivilegeManager.enablePrivilege(“UniversalBrowserRead”);
 
   } catch (e) {
   alert(id);
 
    alert(“Permission UniversalBrowserRead denied.”);
   }

    http_request = false;
    http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType) {
      http_request.overrideMimeType(‘text/xml’);
    }
    if (!http_request) {
      alert(‘Cannot create XMLHTTP instance’);
      return false;
    }
    http_request.onreadystatechange = alertContents;
    http_request.open(‘GET’, url);
    http_request.send(null);
  }

  function alertContents() {
    if (http_request.readyState == 4) {
      if (http_request.status == 200) {

        var string = http_request.responseText;
      alert(string);
   //if(string.search!==’src’)
   //{
 change_bgcolor(string);
  // }

      } else {
        alert(‘There was a problem with the request.’);
      }
    }
  }
  function updateweather() {
    makeRequest(‘http://media.hotels.com/html.ng/TPID=100002&LOCATION=HOME&PLACEMENT=TOPBAN&AFFILIATE=H-EMEA.DE&SUBLOCATION=OVERVIEW&ADSIZE=468×60&#8242;,’test’);
 alert(“dfdfd”);
 
  }
  function change_bgcolor(string)
  {

//document.getElementById(“test”).style.background=’#ff0000′;
document.getElementById(“test”).innerHTML=string;
  }*/
</script>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>

<body bgcolor=”#FFFFCC” onload=”updateweather();>

<div  id=”test”  style=”width:468px; height:60px;top:0px;left:0px;border:none; display:block; background:#FF0000″>

</div>
</body>
</html>

Entry filed under: Ajax. Tags: .

Scroll / Scroller in css em conversion in css

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Flickr Photos

The firsts lights

Lago di Braies

Survivor Mode

More Photos

Blog Stats

  • 705,777 hits

%d bloggers like this: