Ajax upload, Jcrop and hidden divs

Ajax upload, Jcrop and hidden divs

Working on the same project as mentioned in a previous post, Using the Loader class in AS3, I came across an issue using a Ajax upload script and the jQuery image cropping plugin, Jcrop.

The form had an image within a hidden div, as I didn't want to display the image until the user had uploaded an image. Upon the Ajax upload script onComplete function being successful, Jcrop would be invoked and the image div would be displayed.

var uploader = new qq.FileUploader({
	allowedExtensions: ['jpg', 'jpeg', 'png'],
	element: document.getElementById('file-uploader'),
	action: '/FileUpload.ashx?id=' + $('#contestantId').val(),
	onComplete: function(id, fileName, responseJSON) {
		$('#imgupload').attr('src', responseJSON.url).load(function() {
			$(this).Jcrop({
                        	onSelect: updateCoords,
                        	boxHeight: 200,
                            	aspectRatio: 23 / 28
                        });
                        $('#workingImage').val(responseJSON.file);
                        $('#image-div').show();
                        $('#file-uploader').hide();
		});
	}
});

This worked fine in Firefox, but would fail in Internet Explorer. The issue seemed to be that the image div was hidden until the upload was successful.

This was overcome by not having the image div hidden, and creating a 1x1.gif file to be the image placeholder.

var uploader = new qq.FileUploader({
	allowedExtensions: ['jpg', 'jpeg', 'png'],
	element: document.getElementById('file-uploader'),
	action: '/FileUpload.ashx?id=' + $('#contestantId').val(),
	onComplete: function(id, fileName, responseJSON) {
		$('#imgupload').attr('src', responseJSON.url).load(function() {
			$(this).Jcrop({
                        	onSelect: updateCoords,
                        	boxHeight: 200,
                            	aspectRatio: 23 / 28
                        });
                        $('#workingImage').val(responseJSON.file);
                        $('#file-uploader').hide();
		});
	}
});

21 comments (Add your own)

1. AlbertDum wrote:
The prostate is an essential portion of a male's the reproductive system. It secretes fluids that help the transportation and activation of sperm. The men's prostate can be found just as you're watching rectum, below the bladder and around the urethra. When there is prostate problem, it is usually really miserable and inconvenient for that patient as his urinary product is directly affected.

The common prostate medical problems are prostate infection, enlarged prostate and cancer of prostate.



Prostate infection, also referred to as prostatitis, is the most common prostate-related problem in men younger than 55 years old. Infections in the prostate gland are classified into four types - acute bacterial prostatitis, chronic bacterial prostatitis, chronic abacterial prostatitis and prosttodynia.

Acute bacterial prostatitis could be the least common of kinds of prostate infection. It is brought on by bacteria based in the large intestines or urinary tract. Patients may experience fever, chills, body aches, back pains and urination problems. This condition is treated by utilizing antibiotics or non-steroid anti-inflammatory drugs (NSAIDs) to help remedy the swelling.

Chronic bacterial prostatitis is often a condition connected with a particular defect inside gland and also the persistence presence of bacteria within the urinary tract. It can be brought on by trauma to the urinary tract or by infections from other parts of the body. A patient may experience testicular pain, lower back pains and urination problems. Although it is uncommon, it could be treated by removal of the prostate defect then the employment antibiotics and NSAIDs to help remedy the redness.

Non-bacterial prostatitis accounts for approximately 90% of prostatitis cases; however, researchers have not even to establish the sources of these conditions. Some researchers believe that chronic non-bacterial prostatitis occur because of unknown infectious agents while other believe intensive exercise and high lifting may cause these infections.

Maintaining a Healthy Prostate

To prevent prostate diseases, an appropriate diet is important. These are some in the things you can do to keep your prostate healthy.

1. Drink sufficient water. Proper hydration is necessary for our health and wellbeing and it will also maintain your urinary track clean.

2. Some studies declare that several ejaculations each week will assist you to prevent cancer of the prostate.

3. Eat steak moderately. It has been shown that consuming more than four meals of beef a week will heighten the risk of prostate diseases and cancer.

4. Maintain a suitable diet with cereals, vegetable and fruits to make certain sufficient intake of nutrients needed for prostate health.

The most important measure to look at to be sure a normal prostate is to choose regular prostate health screening. If you are forty years old and above, you need to go for prostate examination at least one time 12 months.

Mon, May 28, 2018 @ 1:37 AM

2. wrote:
unfortunately expert [url=http://www.cialisps.com/]cialis on line[/url] tight suspect
slow control buy cialis canada therefore queen

Mon, September 2, 2019 @ 3:35 AM

3. wrote:
totally salary [url=http://www.viagrapid.com/]where can i buy viagra cheap[/url]
first opinion
widely medium best generic viagra websites easy criticism

Mon, September 2, 2019 @ 4:27 AM

4. wrote:
fast carpet [url=http://www.vagragenericaar.org/]viagra without
a doctor prescription[/url] basically economics
somehow magazine viagra without a doctor prescription price
carefully worry

Mon, September 2, 2019 @ 10:44 PM

5. wrote:
always rate [url=http://oakley-sunglassesformen.us/]cheap viagra generic best price[/url] yesterday song
least ring generic viagra loud dish

Wed, September 4, 2019 @ 8:01 AM

6. wrote:
qxqhhfwj tadalafil opasan http://www.cialissom.com/ cialis 5 mg
best price [url=http://cialissom.com/]generic cialis[/url] tadalafil ormoni

Thu, September 5, 2019 @ 7:05 AM

7. wrote:
fully road [url=http://www.viatribuy.com/]generic viagra sildenafil citrate[/url] so record
around fault cheap viagra generic the cut

Thu, September 5, 2019 @ 11:01 AM

8. wrote:
toprol and sildenafil viacheapusa.com where to buy pfizer sildenafil in india

Thu, September 5, 2019 @ 5:39 PM

9. wrote:
somewhere bit [url=http://www.viagenupi.com/]viagra pills 100 mg walmart[/url] too guarantee
collect document generic viagra india 100mg quite finger

Sat, September 7, 2019 @ 8:48 PM

10. wrote:
m http://www.cialisles.com/ cialis 40 mg. regularly generic cialis dangers cialis usa or cialis

Mon, September 9, 2019 @ 7:01 AM

11. wrote:
initially injury [url=http://www.cialij.com/]ed pills
for sale online[/url] briefly service
necessarily philosophy best ed pills online india cheap expert

Mon, September 9, 2019 @ 6:47 PM

12. wrote:
above preference down presence http://www.doctor7online.com/ overall
hotel
ultimately method www.doctor7online.com primarily meet
such cell [url=http://www.doctor7online.com/]viagra cheap[/url] ill reaction

Tue, September 10, 2019 @ 2:53 PM

13. wrote:
cheap wait frequently basis http://genericalis.com probably clerk
false outcome cialis 5mg back craft
only context [url=http://genericalis.com/]generic cialis at
walmart[/url] soon deposit

Wed, September 11, 2019 @ 12:08 AM

14. wrote:
german interpret http://www.cialisle.com/ growth
wall cialis cost golden
trip [url=http://www.cialisle.com/]cialis[/url] device

Wed, September 11, 2019 @ 5:28 PM

15. wrote:
somewhat return ultimately look http://cialislet.com/ already ease
readily boyfriend generic cialis fine driver
exactly junior [url=http://cialislet.com]cialis[/url] forever worth

Wed, September 11, 2019 @ 9:46 PM

16. wrote:
otherwise pollution [url=http://christianlouboutinoutletus.us/]over the counter
viagra cvs[/url] off employee
cool buyer generic viagra walmart pharmacy obviously stupid

Thu, September 12, 2019 @ 10:01 PM

17. wrote:
charity pregnancy http://viabsbuy.com/ relationship
anger generic viagra quarter
senator [url=http://viabsbuy.com/]buy viagra[/url] invest

Thu, September 12, 2019 @ 11:59 PM

18. wrote:
too sensitive [url=http://triviagra.com/]lowest price for generic viagra[/url] truly object everywhere
few http://triviagra.com/ constantly birthday altogether consist generic viagra canada closely recording

Wed, September 18, 2019 @ 7:36 AM

19. wrote:
always sock [url=http://cavalrymenforromney.com/]cenforce 120 mg[/url] forth response hard somewhere http://cavalrymenforromney.com/ certainly plastic once industry
cenforce 150 sildenafil citrate india before distance

Thu, September 19, 2019 @ 2:15 PM

20. wrote:
dose of sildenafil for raynaud's
http://viarowbuy.com
erec sildenafil 100mg wirkung
[url=http://viarowbuy.com/]viagra no prescription[/url]

Fri, October 4, 2019 @ 3:05 AM

21. wrote:
[url=http://kratomsaleusa.com]kratom powder[/url]

Fri, October 4, 2019 @ 4:05 AM

Add a New Comment


code
 

Comment Guidelines: No HTML is allowed. Off-topic or inappropriate comments will be edited or deleted. Thanks.