Every line of 'jquery.ajax header' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
20 function setHeader(xhr, headers) { 21 //"Content-Type":"application/x-www-form-urlencoded" 22 for(var iter in headers) { 23 xhr.setRequestHeader(iter, headers[iter]); 24 } 25 }
44 function parseHeader() { 45 var header = { 46 elements: [], 47 comments: [] 48 }; 49 function fail() { 50 throw new Error("parse error on line " + (currentLine+1) + ": '" + lines[currentLine] + "'"); 51 } 52 if (lines[currentLine] !== 'ply') { 53 fail(); 54 } 55 ++currentLine; 56 function parseElementHeader() { 57 var line = lines[currentLine].trim().split(' '); 58 ++currentLine; 59 var result = { name: line[1], count: Number(line[2]), 60 properties: [] }; 61 line = lines[currentLine].trim().split(' '); 62 while (line[0] === 'property') { 63 if (line[1] === 'list') { 64 result.properties.push({ type: line[1], 65 name: line[4], 66 elementType: line[3] }); 67 } else { 68 result.properties.push({ type: line[1], name: line[2] }); 69 } 70 ++currentLine; 71 line = lines[currentLine].trim().split(' '); 72 } 73 return result; 74 } 75 while (lines[currentLine] !== 'end_header') { 76 if (lines[currentLine].match(/^element.*/)) { 77 header.elements.push(parseElementHeader()); 78 } else if (lines[currentLine].match(/^comment.*/)) { 79 header.comments.push(lines[currentLine].trim().split(' ').slice(1).join(" ")); 80 ++currentLine; 81 } else if (lines[currentLine].match(/^format.*/)) { 82 header.format = lines[currentLine].trim().split(' ').slice(1); 83 ++currentLine; 84 } else 85 fail(); 86 } 87 currentLine++; 88 return header; 89 };
237 function fnHeader(html, content) { 238 var tbHead = content.find('.grid-head'); 239 if (tbHead.length == 0) 240 tbHead = $('<div></div>').appendTo(content); 241 tbHead.html(html); 242 tbHead.find('>table').nextAll().remove(); 243 tbHead.find('thead').siblings().empty(); 244 245 tbHead.find('thead th,thead td').each(function (i) { 246 var that = $(this); 247 /*if (typeof (that.attr('order')) != 'undefined') { 248 that.append('<i></i>').on('click', events.order); 249 } 250 251 if (i == 0 && $(this).find(':checkbox').length > 0 && !grid.singleSelect) { 252 that.find(':checkbox').on('click', events.selectAll); 253 }*/ 254 255 that.html('<div>' + that.html() + '</div>'); 256 if (typeof (that.attr('order')) != 'undefined') { 257 that.on('click', events.order).find('.grid-coll').append('<i></i>'); 258 } 259 if (i == 0 && that.find(':checkbox').length > 0 && !grid.singleSelect) { 260 that.find(':checkbox').on('click', events.selectAll); 261 } 262 }); 263 }