w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Video.js producing intermittent issues
You appear to be dealing with a very dated version of videojs. I've been working with one of the most recent versions of it and have amended a few things. My edits allow you to click anywhere on the thumbnail of the video of a mobile instead of exactly in the center. It also allows responsive videos = http://www.andy-howard.com/recreate-bbc-iplayer/index.html

Categories : Javascript

In Umbraco 6.1.1 MVC 4, how can I do a form post back to a surface controller using a model that inherits from Umbraco's RenderModel?
Ok, I've had no responses to this question but am now in a position to answer it myself. Maybe it was a fundamental oversight, but not that obvious imho, and information on the Umbraco forum etc about inheriting from RenderModel is fairly limited. Essentially the answer, as was my first instinct, is to solve the original exception "No parameterless constructor defined for this object" by providing a paramaterless constructor. The difficulty is working out what to put inside the parameterless constructor for my model, since it inherits from the Umbraco RenderModel which requires an IPublishedContent instance passed to it's constructor. Luckily while browsing around I happened across this post on the Umbraco forum: http://our.umbraco.org/forum/developers/api-questions/40754-Getting-Curre

Categories : Asp Net Mvc

Umbraco MVC Implementation - View does not depend on Umbraco implementations
No you can't. Simply because all requests pass through a single action. In order to retrieve a path to a CMS-managed page, you need to use the node/content traversal the @Model provides. See here for more details on this. Edit To clarify, the author of the article is suggesting that the Umbraco implementation should be more in line with a traditional MVC implementation with little or no logic in the views. Therefore, any querying of node data should happen prior to the view (e.g. in the Mappers). So this is where you would have to retrieve the links. Umbraco's default MVC implementation forces all requests to go via a single action on a single controller. The author's implementation allows the requests to be shared across one controller per document type - which is better IMO. But it st

Categories : Asp Net Mvc

Umbraco MediaService / Umbraco MediaItem not saving
To Save media, I found this method with MediaService. However, I think it's possible another method more refined [HttpPost] public JsonResult Upload(HttpPostedFileBase file) { IMedia mimage; // Create the media item mimage = _mediaService.CreateMedia(file.FileName, <parentId>, Constants.Conventions.MediaTypes.Image); mimage.SetValue(Constants.Conventions.Media.File, file); _mediaService.Save(mimage); return Json(new { success = true}); }

Categories : C#

Umbraco - error when using umbraco.library:NiceUrl(...)
Ok I found a solution: I added an extra check to this part: <!-- Return the url --> <xsl:if test="$i = $max"> <xsl:if test="$id != '' "> <xsl:value-of select="umbraco.library:NiceUrl($id)" /> </xsl:if> </xsl:if> this fixed my problem.

Categories : Xslt

Browser issues related to cookie reading from javascript
I don't think this part looks correct: // Store the cookie Cookie.prototype.store = function () { var cookieval = ""; for(var prop in this) { // ... cookieval += prop + ':' + escape(this[prop]); }; // ... }; Basically, this loops through every global Javascript variable (which has nothing to do with cookies) and adds them to the cookie value. Is that really what you want? Look at the output when I run the following in Chrome: That's going to be a gigantic cookie. All of that aside, the error that your seeing looks like a problem with the Same Origin policy. You can't reference Javascript from a domain outside of your page's domain unless the external domain has a special setup. Google has a few servers with that special setup, so if you don't want

Categories : Javascript

jQuery Cookie not working in Chrome
Open up the console in Chrome, there you'll see what the problem is: Resource interpreted as Script but transferred with MIME type text/plain: "https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js". Refused to execute script from 'https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled. You are embedding a script directly from github, but github serves it with MIME type "text/plain" instead of "text/javascript".

Categories : Jquery

Chrome for mac reports my ASP.NET session cookie as not being Secure
The only time I've ever experienced something similar was when there was already an existing cookie before the secure and HttpOnly flags were set. Try clearing your cookies in Chrome or simply remove the specific cookie(s) for your site by going to the "Resources" tab in Chrome's developer panel (while on your site).

Categories : Asp Net Mvc

Could not locate Razor Host Factory type: umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines
If you are trying to host the blogengine site within a virtual directory of the Umbraco site, then you will have to amend the blogengine web.config to "remove" all the Umbraco-specific handlers and modules, as these will be inherited by the blogengine application, causing this exception because the application can't find the relevant DLLs in its bin folder. I recently had a similar problem and I have posted the web.config I used in the virtual directory below. Mine was a very simple web application, so obviously this will not work by itself in your blogengine app. You will need to add the relevant parts into your web.config file. Also, this was for a v6 Umbraco install in IIS7.5, so you may have to experiment a little. <?xml version="1.0"?> <configuration> <configSecti

Categories : Iis

Modify document.cookie in Chrome console not working
Cookies are set to expire, since we can't really "delete" them, we just force them to expire with a past date. function deleteCookie(name) { document.cookie = name + '=;expires=Thu, 05 Oct 1990 00:00:01 GMT;'; }; deleteCookie('newcookie')

Categories : Javascript

Why doesn't Chrome and Firefox send FormAuthentication cookie in Ajax request
As your asp.net and wcf applications seem to be hosted on different ports (80 and 8080), you may give a try to beforeSend to send credentials : $.ajax({ type: "POST", url: String.format(Service, Method), contentType: "application/json; charset=utf-8", data: JSON.stringify(Data), timeout: 6000, dataType: "json", success: function (e) { OnSuccess(e); }, error: function (e) { OnFailed(e); }, beforeSend: function(xhr){ xhr.withCredentials = true; } }); see http://stackoverflow.com/a/2054370/1236044

Categories : Asp Net

Cannot login to Umbraco 6.0.7 back office using Firefox and Chrome, I am redirected back to the login page but IE and Safari is fine
This is slightly confusing, but can you check that: Your database connection in the staging web.config is correct; and the staging database's user/login has sufficient rights, and is assigned to the database I know you say that Safari and IE work fine, but just to cover the basics it's worth checking the database connections first.

Categories : C#

Chrome Text Issues?
First of all, you shouldn't use quirks mode. Different browsers have different quirks! But honestly, this doesn't look like a browser-related issue to me. On all browsers, the links to the left disappear from view if you make the browser window too narrow. Although it happens at different widths for different browsers, but that could be to do with the fonts used.

Categories : HTML

Chrome setTimeout() timing issues
The problem is you set too many setTimeout functions, with time = 60, there are 60 setTimeouts, so they harm your performance. You can use setInterval instead: function countDown(timeLeft){ var intervalProc = setInterval(function(){ $("#timeLeft").text(timeLeft); timeLeft--; if(timeLeft <= 0){ clearInterval(intervalProc); } }) }

Categories : Javascript

Time out issues with chrome and flask
I believe this is due to your web server (apache in most cases) which has a timeout to small. Try to increase this number For apache, have a look at the timeout option EDIT: I don't think you can do set this time out in Chrome (see this topic on google forums even though it's really old) In firefox, on the about:config page, type timeout and you'll have some options you can set. I have no idea about Internet Explorer.

Categories : Python

How do I fix CSS padding issues between Firefox & Chrome?
What you need is called a CSS reset. http://meyerweb.com/eric/tools/css/reset/ This isn't going to fix your issues (debugging is all you can do at this point) but in the future you should use a reset before you start and it'll prevent having cross browser issues (for the most part).

Categories : HTML

Issues with SignalR and Cross Domain requests in Chrome 27
EDIT: I've found two solutions for this now... Method 1. get rid of crap you probably don't need: As I found in this Stack Overflow question, basically nearly everything I had added in my listing of "things I've tried" above were unnecessary. Steps to fix: Remove everything I've listed that I've tried above. That means no custom headers specified at all in the Web.Config or elsewhere like the Global.asax, no custom jquery settings, etc. .. except for RouteTable.Routes.MapHubs(new HubConfiguration { EnableCrossDomain = true }); In the Application_Start. Also you still need to set the $.connection.hub.url = 'http://localhost:13370/signalr/hubs'; ... that's it. this is probably the best solution and the one I ended up using. Method 2. use jsonp if you're still having problems in Chro

Categories : Asp Net Mvc

jQuery issues (Safari/Chrome) with smooth scroll
This issue with smoothScroll solved my problem. https://github.com/kswedberg/jquery-smooth-scroll/issues/29

Categories : Javascript

jquery validation date format issues in chrome
Here you can find a similar problem description and a workaround. Optionally, you can use the jQueryUI Datepicker validation plugin.

Categories : Asp Net Mvc

CSS Menu Render issues after updating Google Chrome (v.28)
See if there's any @-webkit-keyframes or any @-webkit stuff in the CSS. If there is, move it all to the very bottom of the CSS. On my site, all of the CSS below the @-webkit-keyframes wasn't working properly. Also if you can post code snippets that would be great. SO mods: I would've posted this as a comment, but I'm either unable to (at my current privilege level), or I'm totally not seeing the comment link. Apologies

Categories : CSS

Web pages which works fine in Firefox shows some styling issues in Chrome
Try using a media query, selecting only webkit specific stuff such as: @media screen and (-webkit-min-device-pixel-ratio:0) { /* Your CSS */ } This query checks the device pixel ratio in webkit. Safari & Chrome are the only big browsers using webkit, so this will not affect FireFox or IE.

Categories : CSS

How to use Rack middleware to simultaneously set cookie and send response with cookie in effect
you need to setup your middleware in your application.rb config.middleware.insert_before "ActionDispatch::Cookies", "GeoFilterMiddleware" and in your middleware do something like this: def call(env) status, headers, body = @app.call(env) if from_uk?(env) Rack::Utils.set_cookie_header!(headers, 'country', { :value => 'UK', :path => '/'}) end [status, headers, body] end

Categories : Ruby On Rails

Update jquery cookie pb after addClass , some div shouldn't take class cookie created
have a look at var $qsts = $(".quest").show(); var $anrs = $(".ans").hide(); $('.quest').click(function(){ var $ans = $(this).next().toggle(10); $anrs.not($ans).hide(); }); $('.ans').change(function(){ var $ans = $(this).closest('.ans'); var $act = $ans.prev().toggleClass('question-active', $ans.find('input:checkbox:checked').length > 0) var items = JSON.parse($.cookie('question-active') || '[]'); var qstName = $act.get(0).className.match(/(questiond*)/)[1]; if($act.hasClass('question-active')){ if($.inArray(qstName, items) == -1){ items.push(qstName) } } else { items.splice($.inArray(qstName, items), 1) } $.cookie('question-active', JSON.stringify(items)) }); var items = JSON.parse($.cookie('question-act

Categories : Jquery

What are the obvious vulnerabilities to using a session identifier cookie and a user_id cleartext cookie?
Well, you can always pass the User Id in cookie; however, another way to edit self is to allow "self" or "me" in the URIs to resolve to the sessions current user for example /users/me/profile/ instead of /users/42/profile/ - then however you need to make sure that no data is cached as it would be quite confusing for the users to see another users' profile data as their own. Actually in my latest project we used both of these approaches simultaneously.

Categories : Javascript

jQuery: remove a cookie when closing the browser (session cookie)
There is some code that worked for me. It should expire when you close the browser because of the date to expire being before now: var vEnd = new Date(); vEnd.setDate(vEnd.getDate() - 1); var endOfCookieText = "; expires=" + vEnd.toGMTString() + "; path=/"; document.cookie = escape('testCookie') + "=" + escape("eat cookies") + endOfCookieText; FIDDLE MODIFIED Note that the fiddle gives a bunch of load errors on the console for me.

Categories : Javascript

HttpWebRequest: Add Cookie to CookieContainer -> ArgumentException (Parametername: cookie.Domain)
CookieContainers can hold multiple cookies for different websites, therefor a label (the Domain) has to be provided to bind each cookie to each website. The Domain can be set when instantiating the individual cookies like so: Cookie chocolateChip = new Cookie("CookieName", "CookieValue") { Domain = "DomainName" }; An easy way to grab the domain to is to make a Uri (if you aren't using one already) that contains your target url and set the cookie's domain using the Uri.Host property. CookieContainer gaCookies = new CookieContainer(); Uri target = new Uri("http://www.google.com/"); gaCookies.Add(new Cookie("__utmc", "#########") { Domain = target.Host });

Categories : C#

Adding cookie to HttpServletRequest and retrieving cookie from HttpServletResponse using Mockito
For the request: construct the array, adding any Cookies you want, then add the behaviour to the mock: final Cookies[] cookies = new Cookies[] { ... }; final HttpServletRequest request = mock(HttpServletRequest.class); given(request.getCookies()).thenReturn(cookies); ... pass to controller/servlet etc ... For the response you create the mock and then verify the addCookie call by either using an ArgumentCaptor to capture the actual cookie passed to addCookie: final ArgumentCapor<Cookie> captor = ArgumentCaptor.forClass(Cookie.class); verify(response).addCookie(captor.capture()); final List<Cookie> cookies = captor.getValue(); ... perform asserion on cookies ... Or build the expected cookie and verify: final Cookie expectedCookie = ... verify(response).addCookie(expe

Categories : Java

Loss of '+' characters when fetching cookie using perl's CGI::Cookie->fetch
Cookie values are url escaped, which means that spaces are replaced with the + character and other punctuation marks are replaced with %xx codes. The CGI::Cookie::fetch method decodes the value, and the spaces in your cookie value are restored. You can use the raw_fetch method if you don't want the cookie values to be decoded.

Categories : Perl

SessionAuthenticationModule Cookie Handler not creating HttpOnly secure cookie
I am using the same implementation and do not see your issue using Fiddler2. However maybe the issue is related to your debugging tool? In IE10 debugging tools the secure and http only flags are only displayed when the cookies are first received. If you check using Chrome debugging tools you should see the flags displayed correctly on all requests.

Categories : Asp Net Mvc

Check if a cookie exists NOT using the jQuery cookie plugin
create a function that returns null or false if the cookie doesn't exist : function getCookie(c_name) { var c_value = document.cookie, c_start = c_value.indexOf(" " + c_name + "="); if (c_start == -1) c_start = c_value.indexOf(c_name + "="); if (c_start == -1) { c_value = null; } else { c_start = c_value.indexOf("=", c_start) + 1; var c_end = c_value.indexOf(";", c_start); if (c_end == -1) { c_end = c_value.length; } c_value = unescape(c_value.substring(c_start, c_end)); } return c_value; } var acookie = getCookie("cookiename"); if (!acookie) { alert("Cookie not found."); } FIDDLE

Categories : Jquery

Does a persistent tracker cookie become a session cookie if I setMaxAge(-1)
setMaxAge public void setMaxAge(long expiry) Sets the maximum age of the cookie in seconds. A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age. A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted. Thank you all for your assistance.

Categories : Java

jQuery cookie plugin creates same cookie instead of read it
$.cookie is only read access if no other parameters (but the cookie's name) are supplied to the method [See the source] If you're interested in reading it, just supply $.cookie('UniqueID') and remove the second parameter. As an FYI, path (and other cookie properties) are only relevant when assigning a value, not retrieving. In other words, you don't need to supply path:'/' to get cookies that are applied to that path, document.cookie should natively perform that check.

Categories : C#

Create new cookie or add new cookie if one exists using jquery/javascript (or php?)
Your Code seems little strange to me... And if you try it like this: $(document).ready(function() { $("#button").click(function() { if ($.cookie('cookie_1') == null) { $.cookie('cookie_1', $('#phrase_here').text(), {expires: 7}); } else { $.cookie('cookie_2', $('#phrase_here').text(), {expires: 7}); } }); });

Categories : Javascript

Cookie Code not removing opened element of cookie
Fixed it by using $.map and .join() var openClose = $('.openClose'); openClose.on('click', function() { var cook = ReadCookie('slideHide'), miniParent = $(this).parent().parent().parent().children('.main-content'), miniDisp = miniParent.css('display'); if (miniDisp ==="block") { KillCookie('slideHide'); $(this).parent().parent().parent().children('.main-content').slideUp(); var slide = cook+","+ "#"+$(this).parent().parent().parent().attr("id"); SetCookie('slideHide', slide, 100); } else { $(this).parent().parent().parent().children('.main-content').slideDown(); KillCookie('slideHide'); var newCookie=[], a= $('.module').children('.main-content').filter(":hidden"), c = $.map(a,function(n,i){ return "#"+$(n).p

Categories : Javascript

video replaying issues with video.js on google chrome
The issue is general webpage linking not videojs. The physical movie couldn't be located at http://somedaim.com/?querystring=value Most likely the server or back end code redirect it to the mp4 path without you knowing (videojs wouldn't know this is happening and nor should it). Theres no way around it, you need the physical path to the mp4 file.

Categories : HTML

Intermittent NoMethodError RoR application
Well in this case I don't think I figured out why the error was happening, but I fixed the error by just seeding in start_date and end_date values on job.new like: Job.new({start_date => Date.today, end_date => Date.today}) so the page loads with those fields pre-populated with today's date. Problem never appeared after that, so I'm calling it a solution of sorts.

Categories : Jquery

Intermittent, unexpected FIN & RST problems
The FIN means the server application closed the connection and results in an EOS condition at the client, whereupon the client should close its end too. There's nothing 'unexpected' about that. The RST could have a number of causes, but if you are detecting EOS correctly at the client the RST should be of no consequence whatever.

Categories : Networking

php intermittent undefined from $_get URL
The problem probably stems from using relative url paths. Switch the links over to use site absolute paths (beginning with a /). Assuming questions.php is in the site root (i.e. http://www.mysite.com/questions.php=Wonderboys is a valid url) the url should be /questions.php=wonderboys

Categories : PHP

Intermittent div positioning issue
Floats can be a little finicky. I'd recommend using absolute positioning for this task. These css properties will set the header as the positioning container box, and set the header logo to go in the top right of that box. #header { position: relative; } #header_logo { position: absolute; top: 0; right: 0; }

Categories : CSS

PHP LDAP bind intermittent issue
Based on the Error you can try setting the maximum script execution time in your C:xampphtdocsavrshtdocsldap.php to 60 seconds or something greater than 30 seconds. From your code above it would look something like function isAuthenticated($u,$p) { set_time_limit(60); // Rest of your code from above } set_time_limit documentation

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.