Skip to main content

Posts

Showing posts with the label cross-browser

Detecting a image 404 in javascript

After a user uploads a file we have to do some additional processing with the images such as resizing and upload to S3. This can take up to 10 extra seconds. Obviously we do this in a background. However, we want to show the user the result page immediately and simply show spinners in place until the images arrive in their permanent home on s3.

Can you bind two events to a handler with jQuery?

(By the way, a quick experiment indicates that the answer is "yes", but it might be "it doesn't work in every browser".) I am using a validator plugin that binds something to the submit event of a form. But I want to perform additional validation. It would seem that I can simply bind my additional validation to the submit event. HOWEVER, I worry that that might not work on every browser. Should I expect this to work or will I need to write more complex code?

JQuery issue with no response from server (localhost) with different browsers

I have what is a simple script to retrieve a simple message (string) from server and it appears there is no response from server, so I am wondering if JQuery is even firing off a request at all? The server side script (PHP) is so simple, basically it is just a plain echo. One moment the script is working in FF and the next moment it ain't, as for the other mainstream browsers, you can forget about it! Here is the JQuery script below, do you see anything I'm missing (considering I am new to JQuery / AJAX / Still learning)? Thanks. $(document).ready( function() { $( '.enlarge' ).click(function( e ) { e.preventDefault(); var img = $( this ).children( 'img' ).attr( 'alt' ); var url = '/pages/message/' + img + '/'; $.ajax({ url: url, data: '', cache: false, dataType: 'text

CSS, Javascript functionality issue relating to styled input buttons on newer browsers? (IE 8/9, FF 9)

I'm working on a site where I have input buttons (styled using CSS) that are a part of a form. For example, see below for sample code <input type="submit" name="buttonSave" value="save" id="buttonsavejs" class="button_image button_style"/> I've just found an issue where if a user clicks on the button, it moves a few pixels below and then expected action takes place intermittently . But intermittent , I mean that sometimes it works (redirects the user to the next page) and sometimes nothing happens. The developer who worked on this previously hasn't documented his code much, so I'm trying to work from scratch here (so excuse the lack of details). Anyway, after testing the code, it appears that the issue lies with how newer browsers are rendering the css and javascript. Here's a snippet of the javascript behind the button's functionality: $("#buttonsavejs").click(function(){ $(&quo

Can we access the URL of next request of browser in prevailing HTML page &#39;s unload function

As Html code resides until new url request's response doesn't come .Then Browser calls BeforeUnload and Unload function. This means anywhere in the browser, the url is residing which has been hit for unloading the current one. So is there any way we can get that (new) URL in the Unload function? Actually My scenario is that I want pop up to be opened for providing the other options when user has just hit another URL which doesn't resemble to our domain , showing that he want to go out from our site.