loading

How to show a loading gif mean while a submit form is being executed JQuery

柔情痞子 提交于 2019-11-29 13:22:20
问题 I'm trying to show a simple spinner gif meanwhile a submit is being executed (it takes a bit because I have to establish some communications with providers via web services). So, I have this: $('#gds_form').submit(function() { var pass = true; //some validations if(pass == false){ return false; } $("body").prepend('<div class="ui-widget-overlay" style="z-index: 1001;"></div>'); $("body").prepend("<div id ='PleaseWait'><img src='/images/spinner.gif'/></div>"); return true; }); the thing is,

Are Modern browsers loading scripts parallel or sequentially?

让人想犯罪 __ 提交于 2019-11-29 11:46:03
问题 I'm evaluating existing resources for script loading optimization, but I readed in some articles like this, refers to the older browsers block other downloads until this sequential script loading phase is completed. I check Modernizr(yepnope.js), headjs and ControlJs as candidates. But, is it necesary use this tools for parallel script loading in modern browsers? 回答1: I believe by default most browsers today will actually load the scripts in parallel; but the browser will not by default

grunt faster loading tasks

馋奶兔 提交于 2019-11-29 11:46:00
问题 Is there anybody who can tell me how to get grunt tasks load faster. I really want to reduce the loading time, because most tasks require 1 second to load. Especially for 'watch' task. when I am watching for changes, I really want to compile sass much faster. Any ideas? Thanx 回答1: You are really looking for this: jit-grunt. Instead of loading all tasks every time, jit-grunt will only load those that are necessary. 回答2: Had the same problem as the OP: grunt watch was very slow for compiling

Loading a picture file Image.FromFile VS FileStream

自闭症网瘾萝莉.ら 提交于 2019-11-29 10:37:21
I must admit that I never understood what are the streams are all about- I always thought it's an internet thing. But now I run into a code that used a stream to load a file localy and I wonder if there is advantage for using a stream over... well the way I always loaded files: private void loadingfromStream() { DirectoryInfo dirInfo = new DirectoryInfo("c:/"); FileInfo[] fileInfoArr = dirInfo.GetFiles(); FileInfo fileInfo = fileInfoArr[0]; // creating a bitmap from a stream FileStream fileStream = fileInfo.OpenRead(); Bitmap bitmap = new Bitmap(fileStream); Image currentPicture = (Image

Meteor: iron-router => waitOn without subscribe

会有一股神秘感。 提交于 2019-11-29 08:41:41
i want a loading template to appear before the site has all data to be rendered. And after the serverside Method gives me the Data(from an API [async]) via Meteor.call i want to load the correct layout. I tried many ways found on Google which describe similar but not exatcly the same problem. Including the way to define a function with ready handle, also doesn´t work. I can´t get it running. i don´t want to use Collections because this is user specific Data.( i think this is not efficient to make a collection for each user [no logged in users], or do i miss something) Is this possible? Here my

Chrome AJAX on page-load causes “busy cursor” to remain

﹥>﹥吖頭↗ 提交于 2019-11-29 07:16:42
问题 In Google Chrome, AJAX called within $(function(){....}); seems to keep the page loading. I have a site with a few pages with tabs. Because I'm using cheap godaddy hosting, I want the page to load as fast as possible. I thus want to load a page on 1 tab and then in the background use AJAX to load the other tabs. When I run AJAX from $(function(){ /*AJAX CODE HERE */ }); The cursor shows the page as loading for a long time (http://jsfiddle.net/mazlix/7fDYE/9/) I have figured out a way (in

Loading Indicator on Synchronous Ajax

对着背影说爱祢 提交于 2019-11-29 06:51:59
I'm using ajax with jQuery on my site and need to show a progress / loading indicator. My dilemna is this: Synchronous AJAX locks the browser, so I cant do anything (e.g. show a loading indicator) till the contents are returned, by which time it is too late I am using JSON as the return data type and setting async = true returns an empty response string my whole framework relies on the return type being JSON-formatted I cannot seem to find any way to get JS to give the user an indication that something is in progress, except for doing an alert(). (For some reason an alert does work). Any

Loading a tga/bmp file in C++/OpenGL

痴心易碎 提交于 2019-11-29 06:33:31
I'm trying to load a tga/bmp file. This works fine, but the end result looks like this: The image I'm trying to load looks like this: Some of the code I'm using: GLuint texture; const char* filename = "/Users/Admin/Documents/Visual Studio 2013/Projects/OpenGL/OpenGL/image.tga"; unsigned char* data; data = (unsigned char *) malloc(128 * 128 * 3); FILE* f; fopen_s(&f, filename, "rb"); fread(data, 128 * 128 * 3, 1, f); glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 128, 128, 0, GL_RGB, GL_UNSIGNED_BYTE, data); Does anybody have an idea

using simplemodal, show loading spinner while content inside iframe loads

笑着哭i 提交于 2019-11-29 04:35:05
Good morning! I am using the great SimpleModal plugin for jQuery from Eric Martin. Currently, I am loading a modal using an iframe to load my requested pages which works as expected. What I would like to implement is a Loading... spinner which displays while the content is loading. I am loading my modal as follows: jQuery(function ($) { // Load dialog on click $('.basic').click(function (e) { var src = "http://localhost" + $(this).attr("href"); $.modal('<iframe id="details" class="so" src="' + src + '" height="500" width="500" style="border:0">', { closeHTML: "<a title='Close' class=

Listing the files in a directory of the current JAR file

ⅰ亾dé卋堺 提交于 2019-11-29 03:33:36
I am making a game in JAVA where I want to come up with a list of files in a certain directory in my jar so I can make sure to have a list of those classes to be used in the game. For example say in my jar I have a directory mtd/entity/creep/ I want to get a list of all the .class files in that directory using java code from another class in the jar . What is the best code to do so? Old java1.4 code, but that would give you the idea: private static List getClassesFromJARFile(String jar, String packageName) throws Error { final List classes = new ArrayList(); JarInputStream jarFile = null; try