[Prototype-core] Re: Hijack Browser Loading
You are correct in your assumption of the functionality and unfortunately came to the same conclusion as me in that it can't be done. I do like your idea of setting a cookie maybe once the page is loaded saving wether the browser has JS enabled. Then my server side code could check that cookie on the next page request and serve up all the images if no JS or only the first tab's images if they have JS. The only other option I'm thinking of is wether I could use something like a noscript / block in an image src? Is that valid semantically? mark. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Hijack Browser Loading
[EMAIL PROTECTED] wrote: You are correct in your assumption of the functionality and unfortunately came to the same conclusion as me in that it can't be done. I do like your idea of setting a cookie maybe once the page is loaded saving wether the browser has JS enabled. Then my server side code could check that cookie on the next page request and serve up all the images if no JS or only the first tab's images if they have JS. The only other option I'm thinking of is wether I could use something like a noscript / block in an image src? Is that valid semantically? Ah yes! I believe you can have any content in a noscript block. Just keep the content to a minimum since ninety-someodd-percent people have javascript enabled. Regards, Ken --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Hijack Browser Loading
Just keep the content to a minimum since ninety-someodd-percent people have javascript enabled. Noted. I'll only be including the image url in the noscript / and using the script to dynamically populate the src. That is if a noscript / is allowed in a `src=` attribute. Otherwise I'll have to place the entire image in a noscript, which can work also. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Hijack Browser Loading
[EMAIL PROTECTED] wrote: No matter what I try the images still load. Does anyone know how to hijack the browser and tell it not to load certain images? I might be wrong, but how a browser parses the HTML, decides what to download and when is all pretty browser specific. You probably can't change the way it downloads images. But you can change which images are requested. You could try having your Javascript modify the URLs of images that you want to hold off on loading. They could be changed to request a 1x1 pixel image which should come back pretty fast. And if you change them to all request the same small image then it will only make that request the first time. Then load the real images via JS when you need to. -- Michael Peters Developer Plus Three, LP --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Hijack Browser Loading
You could try having your Javascript modify the URLs of images that you want to hold off on loading. Unfortunately i've tried this out and it still loads the original images even though the swapped out image is displayed. I realize this is probably a browser specific thing, and may not be possible, but I wanted to pick everyones brains and see if anyone could come up with a creative solution. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Hijack Browser Loading
[EMAIL PROTECTED] wrote: Hey guys, I'm building a web app and am hoping to minimize the images loaded per page. I like the way YouTube only loads the thumbnails of the images you can see and then waits till you scroll before loading any others. They do this by placing img / tags for the initial images and then use javascript to fill out the rest. The only problem with this is someone without javascript won't see any of those additional images. So my question, and thought, was to do something like this: This looks like a question for the Rails-Spinoffs group. A simple unobtrusive approach would be to have a drawer of thumbnails with a link to view more images. For JavaScript enabled browsers, simply override the functionality of that link to load a list of image locations from memory or by AJAX. An image will be downloaded by the browser anytime 1) it parses an img with a src attribute, 2) an img node with a src attribute is added to the DOM via JavaScript, or 3) any existing img has its src changed via JavaScript. This should be standard across all browsers. As a developer, you should be able to control when images are loaded by keeping these three in mind. Note that browser image caching rules apply according to the HTTP headers sent with the image. --Ken Snyder --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Hijack Browser Loading
[EMAIL PROTECTED] wrote: A simple unobtrusive approach would be to have a drawer of thumbnails with a link to view more images. For JavaScript enabled browsers, simply override the functionality of that link to load a list of image locations from memory or by AJAX. The only problem with that is people without JavaScript don't see those additional images. Let me explain a little more: I have three tabs, and only one can be viewed at a time. Therefore, I'd really only like the images to only be loaded in the first viewed tab, there's no since loading images in a tab people can't see. Then when people click over to another tab those images are loaded. Make sense? No. I don't see how you can click over to another tab or load more images unless you use JavaScript and or provide a link that loads a new page with new images. You can only control the loading of images by changing the URL or JavaScripting. Maybe provide an example page? --Ken --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Hijack Browser Loading
Here's a prototype I was working on: http://code.markhuot.com/image_trick/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---