View source html
r wrapper = document.getElementById( 'xt_auth_container' ); var tmp_class = wrapper.className; var current_action = xhr.response.split( ';' )[1]; var actions = { bookmark: 'xt_auth_action_star_active', vote: 'xt_auth_action_rate_active', subscribe: 'xt_auth_action_subscribe_active' }; for ( key in actions ) { if ( !actions.hasOwnProperty( key ) ) continue; if ( current_action.indexOf( key ) == -1 ) continue; wrapper.className = current_action.indexOf( 'un' ) == -1 ? tmp_class + ' ' + actions[key] : tmp_class.replace( (' ' + actions[key]), '' ); } } xhr.response = xhr.response ? xhr.response : xhr.responseText; (xhr.status != 200 || xhr.response.indexOf( 'ERR;') != -1 ) ? handle_error(xhr) : handle_success(xhr); } //load_data( { url: url, method: method, data: data, async: async, xhr_done: xhr_done, callback: callback }); function load_data( settings ) { var async = settings.async ? !!settings.async : true, url = settings.url ? settings.url.toString() : false, method = settings.method ? settings.method.toUpperCase() : 'GET', callback = settings.callback ? settings.callback : false, data = settings.data ? settings.data.toString() : '', xhr_done = settings.xhr_done ? settings.xhr_done : null, xhr; // xhr in progress or url not provided -> exit if ( !( (xhr_done == true || xhr_done == null) && url ) ) return; if ( typeof XMLHttpRequest !== 'undefined' ) { xhr = new XMLHttpRequest(); } else { try { xhr = new XMLHttpRequest("MSXML2.XmlHttp.5.0") || new XMLHttpRequest("MSXML2.XmlHttp.4.0") || new XMLHttpRequest("MSXML2.XmlHttp.3.0") || new XMLHttpRequest("MSXML2.XmlHttp.2.0") || new XMLHttpRequest("Microsoft.XmlHttp"); } catch ( e ) {} } // if xhr object does not supported or url not given, exit xhr.onreadystatechange = function () { if ( xhr.readyState != 4 ) return; if ( xhr_done != null ) xhr_done = true; callback ? callback( xhr ) : null; } xhr.open( method, url, async ); if ( method === 'POST' ) { xhr.setRequestHeader( "
[7]Page:[<=]5[=>]
Jump to page:
Total character: 23356
[Main]