博文

目前显示的是标签为“jQuery”的博文

center element

<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"></script> <style> .cssAmount{font-size:2em;} .col-center-block {     float: none;     display: table;     margin: 0 auto;     /* margin-left: auto; margin-right: auto; */ } .img-fluid{max-width:100%;height:auto} .rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important} .rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important} .rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}. rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important} .rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0...

jQuery and Form

inside posting page function postToError ( CBaseError ) { var e = encodeURI ( JSON . stringify ( CBaseError . errors ). replace ( /"/ g , '&quot;' )); //way 1 $('<form action="./ErrorP" method="post"><input name="error" type="hidden" value="'+e+'"></form>').appendTo('body').submit(); //way 2 var newForm = $ ( '<form>' , { 'action' : './ ErrorP ' , 'method' : 'post' }). append ( $ ( '<input>' , { 'name' : 'error' , 'value' : e , 'type' : 'hidden' })); newForm . appendTo ( 'body' ); newForm . submit (); } inside page posted to < script > var Error ={ "errors" :[]}; var e = '@ViewData["Error"]' ; e = e . replace ( /&quot;/ g , '"' ); var a = decodeU...

jquery ajax 'Authorization' 'Bearer' 'Basic'

https://stackoverflow.com/questions/5507234/use-basic-authentication-with-jquery-and-ajax Method 1: var uName = "abc" ; var passwrd = "pqr" ; $ . ajax ({ type : '{GET/POST}' , url : '{urlpath}' , headers : { "Authorization" : "Basic " + btoa ( uName + ":" + passwrd ); }, success : function ( data ) { //Success block }, error : function ( xhr , ajaxOptions , throwError ){ //Error block }, }); Method 2: var uName = "abc" ; var passwrd = "pqr" ; $ . ajax ({ type : '{GET/POST}' , url : '{urlpath}' , beforeSend : function ( xhr ){ xhr . setRequestHeader ( 'Authorization' , "Basic " + btoa ( uName + ":" + passwrd )); }, success : function ( data ) { //Success block }, error : function ( xhr , ajaxOptions , throwEr...

JQuery

Basic Syntax of JQuery: $(Selector).action() $: Indicates it is a jQuery. Selector: 3 types of name Id of an element (prefixed by # ). $(“#myButton”) - selects html element with id “ myButton ”. HTML element itself. $(“p”) - selects html paragraphs. CSS class (prefixed by . ( Period )) Etc. $(“.myclass”) - selects html elements which have their class ” myclass ”            //get the parent's the jQuery element.           var tblTmp =window.parent.$('#tt');           var data = window.parent.$.fn.panel.defaults.extractor(data);           var tmp = window.parent.$('<div></div>').html(data); Examples: $(":checkbox, :radio").click( showValues ) ; -for all <input type="checkbox" ...> and all < input type = "radio" ...> $("select").change( showValues ); -...