Angular image loading [duplicate] - html

This question already has answers here:
How to load image (and other assets) in Angular an project?
(10 answers)
Closed 7 months ago.
I have a question about how angular and webapps work in general;
Let's say I load image once on my landing page, and then reuse the image on another page in the same domain using router-outlet. Does this image load once for every page, or can I reuse it later for background purposes without much dalay/any at all, because the image is already loaded?

Your question can actually be answered without considering the specific JS framework you are using: as long as your are using the same path for loading the image the image is actually taken from the browsers cache after it was initially loaded.
Please note that you can disable this behaviour temporarily while developing when you open your development tools (F12) in your browser an tick "Disable cache" in the Network tab:
Often the opposite of your question is the problem - how can I as a developer prevent the browser to cache an image.

Related

Is it possible to make an entire website transparent (see desktop/other programs through it) [duplicate]

This question already has answers here:
Is it possible to make part of the browser transparent to display underlying desktop/windows in a web app? [closed]
(4 answers)
Closed 4 years ago.
I am developing a plugin/theme for a javascript based application. I want to make the whole application transparent so that the user can see their background through it like you sometimes see on a linux terminal with xfce (refernece image: https://i.ytimg.com/vi/532IJ7P4RGk/maxresdefault.jpg). I have tried adding transparnecy to all of the elements including the background to no avail.
Thank you!
No, it is not possible. CSS/HTML renders in browser and you can't set "transparency" of the browser with css.

Hiding images from HTML code [duplicate]

This question already has an answer here:
Protect images download theory
(1 answer)
Closed 7 years ago.
I want to hide images from my HTML code. I've disabled right click, which is pretty easy however the page source can still be viewed. Is there a way to hide all images from the HTML code so that the images cannot be stolen from the source code?
I'm afraid that there isn't a way to 100% stop a user of your site from getting into the code.
Not sure what the images are for but a couple of things you can do are:
Watermark your images.
Obscure the link by converting it into hexadecimal. (More on this on Google)
Bury it in divs or a table
Use Low Res images.
But as you've already disabled right-clicking that stops casual users from taking them.
Your browser will always need som kind of source to view the image, so you'll always be able to find it in the source code. However, there are ways to make it a little bit more complicated.
For example, using PHP, you can load the image through a script to hide the real URL and prevent some users from seeing it.
But remember, if the image is visible on the page, there will always be ways to steal it.
If you publish something in the web, you can't restrict the user. They can save anything from your page to their computer. But you can use watermarks on your images but still the user can download but can't steal.
Other way is you can convert your image into data-uri so user can not download the image. But it has its own limitation. But it may worsen your site's performance depending on number of images and size of the image.

How does the twitter website prevent white pages between page loads? [duplicate]

This question already has answers here:
How is Github Changing Pages and the URL so smoothly without AJAX?
(2 answers)
Closed 8 years ago.
When I am using the twitter website https://twitter.com/ and click on the tabs on the top there does not appear to be any white page where the page is loading. If I click on a different tab I see a spinner in the middle top of the page then the new page appears instantly without a blank white page in-between.
How is this achieved? I should note I am using Google Chrome web browser.
Small update to this, I noticed white page in between my pages and was comparing it to twitters page load. Then I took out the modernizr javascript library then my page rendered fast just like twitter and I don't notice white page in-between. So I think, this question is really not a good question now as the reason I was seeing white page was the modernizr library.
They are using AJAX, check it out
AJAX Wikipedia article

Is there a way to access the main graphics context of the HTML page? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Using HTML5/Canvas/Javascript to take screenshots
Is there a way to copy the main graphics context of the HTML page into a canvas?
From Javascript, I'd like to grab a "screen shot" of the current visible HTML page and copy it to a thumbnail image or canvas. (Not from a separate "screen capture" app, but from within the javascript page itself)
You can't do it.
But If you using google chrome you can write a chrome extension, this give you new javascript functions for capturing images, for example:
chrome.tab.captureVisibleTab( ....)
For example, you can check the source code Webpage Screenshot Extesnion:
https://chrome.google.com/webstore/detail/webpage-webcam-screenshot/ckibcdccnfeookdmbahgiakhnjcddpki

How to stop a GIF from animating after a certain amount of time (on a web page)? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Stopping GIF Animation Programmatically
When I have a page open with an animated GIF in it, and the tab is active in the window, it uses up CPU.
I'm wondering if there's a way to mark up the HTML so that a GIF will play for a specified amount of time or number of loops.
Or perhaps I am best served by using a static image and setting its source to the GIF on hover (which I believe most mobile browsers patch by allowing hover to be set on tap).
I don't believe HTML or the DOM provides any control over GIF animation, but you can exercise a limited amount of control from your image generation tool over the number of loops.
For example, in Photoshop:
IE9 and Chrome respect the loop count; I imagine that all browsers do, though I can't find a mention in the spec for how looping is supposed to behave.
GIF89a Spec
If you can't modify the images, or want to stop them at different times, perhaps just replace the animated GIF with a static GIF using a bit of JavaScript.
I use Fireworks to make animated gifs and from within fireworks you can adjust those settings without having to do anything to the html.