Posts

Showing posts with the label Jquery

HTML5 Game Asset Manager and Loading Screen

     Its important initialize a game if and when it is ready. I probably spent probably about two weeks looking for examples of this idea.One thing I was hope to get from this process was a way accurately update the loading and give the user a percent of when the game has loaded.For accurately updated the loading bar the best I have come up with is to have counter based on the number of assets and after each assets is loaded update the bar. The following setup is for the start button to change when the assets are loaded.   <button ><span class= "label" id= "Gamer" > Loading </span></button>     Follow code is taken directly from the example on  HTML5 Rocks  but I collected it into a single script and it proved to be very useful. I was working on some logic to queue not only images but sounds because more often than not audio files are larger than image files. Keep in mind though there is not a universal format that is supported like

Bootstrap Typeahead/Autocomplete

    This UI feature goes by many names and whatever you call it is currently no included in the bootstrap project as of 3.1.1 but that might change in later versions. No all hope is lost, actually had found multiple alternatives to import this feature with no dependencies! My biggest concern I had at the start of my research for this feature was that I would have to include Jquery UI which as Autocomplete. Not that there is anything wrong with Jquery UI but I try to avoid adding too many third party styles into my applications. I also try to leverage the css files that I do have as much as possible. So below is two solutions that I am very comfortable with using and strongly suggest. Typeahead/Autocomplete Projects https://github.com/twitter/typeahead.js/ https://github.com/devbridge/jQuery-Autocomplete  -  Another approach which I have used. Resources jquery - Where is the typeahead javascript module in bootstrap 3 RC 1? - Stack Overflow Install typeahead in Bootstrap 3, fix

Bootstrap Dropdown-Checklist

    When it comes to web development there is a lot of ways achieve what you want but more importantly it is critical to know what to look for if you have no clue how to achieve it. Over the last five years I have become very efficient at finding examples to achieve my work and to push that even further what I have done is put those code snippets in my back pocket for other projects. Some codes I come across I modify for my own use, others I can simply plug n' play but having that code off hand is quicker than writing it. So what I'm leading up to is an example of that concept. I had a task recently to make a dropdown styled in bootstrap , where inside the dropdown was a series of checkboxes. Now by default the behavior for bootstrap would close dropdown immediately after I clicked. What I need is to keep the dropdown open until it is blurred. What I found with a quick search was what I needed but still once I had the code, and rather than just plugging' it in. What I did

Asp.Net MVC: Error Handling Ajax Partial Views

During the second year of my job as a Application Developer I was ask to design some type of error handler to properly display partial views that were pulled in via ajax. What was currently happening was that partial errors were being displayed as full page error and causing other issues when Jquery libraries being loaded in twice. Questions Could you create a partial view and full view error page for display appropriately for both? So in the case where it was a partial view error the error page would simply display inside the partial. Is there a way to determine by ActionResult type the error handler needed? My Solution ///This is an attribute for PartialViews. It handles any errors and override the basecontroller's OnExpection method. public class PartialErrorAttribute : HandleErrorAttribute { ///Similar setup to the base controller OnExpection method, but has a special partial view error page called _ErrorPartial".<summary> /

Updating Jquery Nuget Package to 1.11

       I feel a lot of developers out there are unaware of the fact that they can update Jquery without any work, and since I did the digging already I wanted to get other developers excited about Jquery 1.11.  If  currently you try to update the Jquery Nuget package via the package manager currently is will only display Jquery 2.x.x which may break some javascript instead use the simply use the command console to update.  So if your using Jquery's Nuget package with your Asp.net MVC application it's easy to update from 1.10 to 1.11. There is no breaking changes from what I have read with the update and if you're trying to support IE8 you should be in the clear as well. Command PM> Install-Package jQuery -Version 1.11.0 Also just as a personal note I find the  warning message that appears for jquery 1.10 to be extremely annoying and I feel its my mission to help out others by removing it from the internet. Update Can I keep Nuget on the jQuery 1.9.x/1.x path

Setting up QunitJs for Asp.net MVC Debugging

    Using  QUnit  is important for me on some of my projects that are more front-end driven. So developing, debugging and testing all need to happen in javascript but without being in the final production. One thing I do not want to do is include the QunitJs in my bundles and would serve no purpose because the bundling and minifying does not happen for debugging. Instead what I did was create an extension method and return a bool, like the one shown in the resources. //Location ../Helpers/IsDebugging public static bool IsDebugging(this HtmlHelper helper) { #if DEBUG return true; #else return false; #endif } //Location ../Views/Shared/_Layout.cshtml //These two files are not apart of any bundled packages. @ if(Html.IsReleaseBuild()) { @ Scripts.Render( "~/Scripts/qunit-1.14.0.js" ) @ Styles.Render( "~/Content/qunit-1.14.0.css" ) } Side Notes The intellisense will do some weird things with the coloring for code inside the else sta

Research on JQuery Editable Table Plugins

    My goal here was to find or create a jquery editable table that I could custom to my needs with a little or no work and helpfully be easy to maintain. I also wanted to make sure that what I chose would not impact how I implemented my back-end. The following is the basic a starting point of what I am working with but not limited to... <table class = "table table-condensed" > <thead class = "storage" >< / thead> <tbody>< / tbody> < / table> From this point I would pull my table data in by either a model binder or simply create the table via ajax and appending it there. Still is without looking at how a plugin is design or needs to be setup so I might have to look at that before I begin implementing which I got with. I started my research by listing what I was looking for and what I thought I might have to customize. My Requirements  Input check for duplicates. character input limiting (no more than 12 c

Jquery Ajax with BlockUI Plugin

    I love making Ajax calls and if a user is interacting with a page and doesn't need to refresh or be redirected to another page than an Ajax call is the best thing to use in my opinion. With my best efforts I try to give my users an experience where every action has a result. This means everything even if the reaction is simple or does nothing more than alert the user. I like to let the user know that all is fine and meant to be the way it is. If an error happens they should be alerted as well. Which I should also try to prevent and recover from, but what about with an ajax call that takes a while to process? Well I have been using a really cool process with my code where I can display to my users that the process is going through. With "Please wait..." message users can see it is order is being processed and controls will returned to them when it has completed.     You can see an example here  and to go a step further then this I thought this would be a cool place t

Penguins Rising: Eliminate render-blocking JavaScript

Image
For the most part I have already done a lot of the work for this and this has always been something in my practice to do. In the past what I have done is render all javascripts at the bottom of the page and all styles at the top inside the header. However with this application and since so much of my code is customized and mineralized, I believe I have a small issue with the Jquery taking up more time than the css to load. So Close to 100/100! Code (function () { var script = document.createElement('script'); script.setAttribute("type", "text/javascript"); script.setAttribute("src", "js/jquery-2.0.3.min.js"); document.getElementsByTagName("head")[0].appendChild(script); Resources Remove Render-Blocking JavaScripts - PageSpeed Insights — Google Developers HTML script async Attribute  - This might have also worked but look at later. javascript - load jquery after the pa

HTML Select Placeholder

Update     Adding a selected and disabled attribute works as well and doesn't require any javascript, however refreshing the page does not reset the value. Doing a hard refresh does reset the value (for firefox) . However there seems to be a placeholder attribute in draft (as of november 2014).  " When there is no default option, a placeholder can be used instead". However in the example the placeholder value is still selectable after a choice has been made. This may not be what you want, so combining the two attribute and the javascript below  guaranty the behavior I'm looking for.  I could even support older browser with a little work.     The Purpose of this article is to make a placeholder in select that should help prevents bad selections with and make it easier to validate if no selection is made. In this article I will assume you have Jquery and the Jquery Validation plugin installed on your web application and similar html code displayed like the the fo

My First Windows 8 App publishing Experience

Image
Introduction     I have a lot of experience from web development so I decided to take a blackjack game that I created in JavaScript and just edit it enough to be published on the window 8 app store. I will include a lot of my experiences but also my opinion. It took me about a month to make this game, the content and the functions within the game. The styling I edited later in the game, but in the beginning it was very dull for the most part and not very metro style looking. Don't have the original image of what the game looked like but just take my word that it needed improving. Here is how it looks now... you can find it  here ! ...As the picture explains and what I have not told yet is that my game is called "BlackJack the King of Cards". If you would like to download the game you can find it in the market under free card games. Windows 8 App     Ok, so lets say you have an window's 8 app ready to go. You go to the Store tab top of your visual studio w

A Guide for the 70-480 Exam

Introduction     This is simply a guide and in it will not will provide you with any answers to the actual questions that be on the exam nor guarantee that you will pass the exam. However I have taken the beta test now and can show you references to what topics that may be on the exam. So with that said I hope this guide helps and don't forget to comment if I leave something out.     On the  certification page  you will find a list of topics and the skills of measurements that will be required to pass the exam. Following these four areas will be of great help, however from my experience I can say that it is not enough. You much actual practice using these skills to get a better at them (good time to use  jsfiddler !). There many books that can help, and depending on your level of skill will point you to the right direction. However note that you don't have to buy any books or services to pass this test. I am only point them for purpose of being resources to you. Pr

Game Development Research for Penguins Rising

Introduction This is my research for Penguins Rising and in my search for studies on how to create the ultimate web based game. This list of links were helpful in concepts as well as implementing code in to the game. Part I "A Framework for Game Engine Based Visualizations" Advance Your Education With Free College Courses Online - Udacity PEGI Pan European Game Information - What do the labels mean? Foxes and Shotguns animation - How can you get different objects working at different framerates working in html5 canvas? - Stack Overflow JavaScript Timing Events HTML5 Canvas resize to fit window - Stack Overflow canvas · html · WPD · WebPlatform.org console.log - Web API reference | MDN HTML5 Canvas Image Tutorial Function - JavaScript | MDN WebPlatform Docs · WebPlatform Docs · WPD · WebPlatform.org #AltDevBlogADay » Brewing Your Own Game Analytics Service Free Music Archive: Dubstep Box2DJS - Physics Engine for JavaScript HTML5 Certificate - Udacity

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql