Posts filed under 'Ajax'

Applying background dynamically from ajax [ iframe issue ]

<!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′,’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>


Add comment August 6, 2007

AJAX Technologies

The following technologies are typically included in AJAX: l Cascading Style Sheets (CSS), a markup language for defining the presentation style of a page, such as fonts and colors.l JavaScript, a scripting language. One element of JavaScript technology that is key to AJAX is XMLHttpRequest, an object that is used to exchange data between the web client and web server.l Document Object Model (DOM), which provides a logical view of a web page as a tree structure.l XML, the format for sending data from the web server to the client. However, you can use other formats, such as HTML, JavaScript Object Notation (JSON), or plain text.
Like other web applications, an AJAX-enabled web application uses a markup language such as HTML or XHTML to present web pages, or a server-side technology such as JavaServer Pages (JSP) technology to generate web pages. In addition, server-side application systems play a key role in processing AJAX applications. A server-side application system such as Java Platform, Enterprise Edition (Java EE), that includes support for data validation, user identity management, and persistence fits very well with the AJAX methodology. See the AJAX and Server-Side Java Technologies section of this article.

Figure 1 illustrates how these technologies work together to handle a user action that triggers an AJAX response

1. A user generates an event on the client. This results in a JavaScript technology call.

2. A JavaScript technology function creates and configures an XMLHttpRequest object on the client, and specifies a JavaScript technology callback function.

3. The XMLHttpRequest object makes a call — an asynchronous HTTP request — to the web server.

4. The web server processes the request and returns an XML document that contains the result.

5. The XMLHttpRequest object calls the callback function and exposes the response from the web server so that the request can be processed.

6. The client updates the HTML DOM representing the page with the new data.You can incorporate these technologies into a web application in a variety of ways.

For example, you can write JavaScript technology code in an HTML page, or you can use a library such as one in the Dojo toolkit to provide part or all of the JavaScript technology functionality you need. In addition, you have server-related choices regarding AJAX.

Figure1


Add comment April 30, 2007

Get Started

AJAX stands for Asynchronous JavaScript And XML.

AJAX is a type of programming made popular in 2005 by Google (with Google Suggest).

AJAX is not a new programming language, but a new way to use existing standards.

With AJAX you can create better, faster, and more user-friendly web applications.

AJAX is based on JavaScript and HTTP requests.


Add comment April 10, 2007


Spam Blocked

Flickr Photos

THE-GROUP-YOU-CANNOT-GET-INTO-ANYMORE

.pouting.

L'informarsi, prima di tutto

More Photos

Categories

Links

Calendar

August 2008
M T W T F S S
« Jun    
 123
45678910
11121314151617
18192021222324
25262728293031

Recent Posts

Recent Comments

Sachin Gajraj on Top 50 Govt Engineering C…
Sachin Gajraj on Top 50 Govt Engineering C…
KUSHAGRA on Top 50 Govt Engineering C…
Siber on 5 useful PHP functions for MyS…
Daniel Tome on Applying background to Iframe …

Pages

Top Clicks

Top Posts

Blog Stats