AJAX call following 302 redirect sets origin to null
See here, this seems to suggest its related to a “privacy-sensitive” context. Are there any browsers that set the origin header to “null” for privacy-sensitive contexts?
See here, this seems to suggest its related to a “privacy-sensitive” context. Are there any browsers that set the origin header to “null” for privacy-sensitive contexts?
There are several techniques, which when used together provide a sufficient CSRF protection. Unique Token A single, session-specific token is good enough for most applications. Just make sure that your site doesn’t have any XSS vulnerabilities, otherwise any kind of token technique you employ is a waste. AJAX call to regenerate the token is a … Read more
load() is just a shortcut for $.get that atuomagically inserts the content into a DOM element, so do: $.get(“logFile”, function(response) { var logfile = response; });
After updating datatable you have to invoke it’s client side filter() method. <p:dataTable widgetVar=”dataTableWidgetVar” id=”dataTable” var=”row” value=”#{bean.value}” filteredValue=”#{bean.filteredValue}” paginator=”true” rows=”25″ paginatorPosition=”bottom” rowKey=”${row.id}” editable=”true”> <p:commandButton value=”Save” actionListener=”#{bean.save}” update=”:form” oncomplete=”PF(‘dataTableWidgetVar’).filter()”/> For PrimeFaces versions older than 5, you should use <p:commandButton value=”Save” actionListener=”#{bean.save}” update=”:form” oncomplete=”dataTableWidgetVar.filter()”/>
Yes, JSONP is slightly different when it renders, so your server needs to support it. JSON looks like this: { “name”: “value” } Whereas JSONP looks like this: functionName({ “name”: “value” }); If whatever you’re using supports it you’re covered, but it’s not the same as supporting just JSON. When the server gets a request, … Read more
You could write a custom error filter: public class JsonExceptionFilterAttribute : FilterAttribute, IExceptionFilter { public void OnException(ExceptionContext filterContext) { if (filterContext.RequestContext.HttpContext.Request.IsAjaxRequest()) { filterContext.HttpContext.Response.StatusCode = 500; filterContext.ExceptionHandled = true; filterContext.Result = new JsonResult { Data = new { // obviously here you could include whatever information you want about the exception // for example if you … Read more
Here is a ajax example of jqueryui tootip widget from my blog.hope it helps. $(document).tooltip({ items:’.tooltip’, tooltipClass:’preview-tip’, position: { my: “left+15 top”, at: “right center” }, content:function(callback) { $.get(‘preview.php’, { id:id }, function(data) { callback(data); //**call the callback function to return the value** }); }, });
I generally set up the question as thus: Does anything important change after the request? (Logging and the like notwithstanding). If it does, it should be a POST request, if it doesn’t, it should be a GET request. I’m glad that you call POST requests “slightly” more secure, because that’s pretty much what they are; … Read more
After digging for a day and a night in the guts of the internets, here is what I came up with: server-sent events – Very cool, currently works only in Opera, but may be part of HTML5 and other browsers may support it sometime. Adds a new element tag with content-type of “application/x-dom-event-stream” which allows … Read more
you could set your own window name, the exact syntax escapes me right now, but you can use the current time and session id to create a unique id on window load, then use that id This would be done the same way you set a name in the javascript window.open() function, (but you can … Read more