Click here to Skip to main content
15,880,392 members
Articles / Web Development / HTML5

Developing Web 2.0 User Interface for Self Hosted WCF Services using HTML5, CSS3 and JQuery

Rate me:
Please Sign up or sign in to vote.
4.08/5 (8 votes)
24 Jul 2011MIT5 min read 69.1K   684   26  
Devloping Web 2.0 user interface for self hosted WCF services using HTML5, CSS3 and JQuery
var auth;
var aboutPage ;
var statesPage ;
window.onload = function () { 
  auth = new LoginPage();
  auth.loadLoginPage();
  $('#a_states')[0].onclick = loadStates;
  $('#a_about')[0].onclick = loadAbout;
}	

function getdata(path, type, successhandler) {
  $.ajax({url: path,	
    dataType: type,
    type: "GET",
  beforeSend: function(xhr, settings) {
    xhr.setRequestHeader("Authorization",auth.getToken());
  },
    success: successhandler,
    error: function(xhr,error) {
      if(xhr.status==401) {
        auth.loadLoginPage();
      }
    }
  });
}

function loadAbout () {
  aboutPage = new AboutPage();
  getdata('/about.htm','html', function (data, textStatus, xhr) {
    aboutPage.loadAboutPage($(data));
  });
}

function loadStates () {
  statesPage = new StatesPage();
  getdata('/states.htm','html', function (data, textStatus, xhr) {
    statesPage.loadStatesPage($(data));
  });
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Architect
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions