Classic ASP loading graphic - javascript

I need to display a loading graphic (whilst sql query runs) during the loading of an asp page.
Have set a graphic to show (animated gif) which shows via response.flush() just after the graphic is referenced and hides via javascipt onload.
All work perfectly except that my AVG antivirus setup (and therefore I expect most others') gets in the way of the buffer flush as presumably it is analyzing the stream of html/javascript, so the page just loads as one lump.
Any thoughts? (or perhaps another way of doing this via classic asp/javascipt?)
Many thanks

you may want to have a look at the following related questions:
Loading screen in classic ASP page
show loading message while loading contents in asp using jquery ajax

Related

Why is the Facebook button only appears after all the images are loaded?

This is not about loading Facebook asynchronously or any kind of optimization here but to load it as fast as possible rather than as slow as possible ;)
My website contains a LOT of images. And I need the Facebook Like button to show up as soon as possible. But it seems the button doesn't load: it waits for all the images to be loaded before loading itself. Since I have many images, of course the Like button shows up very late. If the connection is really slow, that might even take one minute. You can see the issue here: http://www.totorotimes.com.
Any idea how I could do this?
Thanks a lot!
Take all the javascript code that is for the social media buttons out of your body tags, put them in a file called: "social.js" and then insert that file right above all the js files in yourhead tag. This will make your buttons load before the actual web page loads.

How to open a webpage and run your JavaScript on it?

I am trying to load a webpage then insert my own Javascript into it.
I have the current code here:
window.location.assign('http://http://79.170.44.75/hostdoctordemo.co.uk/downloads/vpn/index.php');
document.getElementById('address_box').value = prompt("Site Address: ");
document.getElementById('go').click();
and what I am trying to do is:
Load the webpage
Set the address box to a value
Simulate a mouse click on the search button
So it loads the webpage, then searches a value it sets itself.
The problem with my current JavaScript is that as soon as the webpage has loaded the JavaScript stops working (as I expected). I have tried using the iframe tag to load the webpage 'within the webpage' but that did not work when obtaining the id and people said iframe would also not work because of the resolution difference.
**The Question: ** How do I load a webpage and run my own JavaScript code on it? Thank you!
Matthew
You're propably looking for something like Greasemonkey.
I really can't see an easy way to do what you want.
When the browser receives a web page from a server the javascript is interpreted, and only after that, the page is presented on the screen.
So you would have to have a web page with a button or other mechanism to make a request to a web server, receive the request, save its contents locally, add your javascript code and only then "give it to the browser".

Load screen on page reload();

I have a small Phonegap app and on a button click I have it refresh the page via:
window.location.reload();
It loads pretty fast. However, although fast, you can see a flash of some elements being loaded before others. I would like to do some sort of load screen during this time, which I think will be a nice touch.
What might be the best way for me to do this? It wouldn't be at application start, but somehow tied into the button that calls for the page to be refreshed.
BTW, I am not using Jquery Mobile or Zepto .
Thanks
I'm not too privy on phonegap but I believe it is just normal HTML, CSS and JS no? So then why not just have an AJAX request that grabs your data, so the page itself is not actually refreshed but the data within the container. Then just have a div prepended to the body on the refresh call that contains your loader information (spinning gif, loading, etc). Then disappears on the ajax callback.

Take a screenshot of a certain website at a given moment

I want to take a screenshot from my website of another website or preferable 1 part of it (an object tag).
I want it to work this way: I click on a button that will send a request to screenshot the page at this moment. Several ideas are insert the page inside a flash object and screenshot it. Or opening a browser on the server and when I click the button send a request using AJAX to tell the server to screenshot with this browser.
How should I do this because I kind of failing right now with the flash Idea. The page I am trying to screenshot is a live camera that uses a .wvx object. But I can't even do that with a .swf object.
Thanks!
You can try phantomjs. They have several examples of renderding page output. It supports plugins like flash too.
render() always renders the entire page. To just render one <object> tag, I guess you can do one of:
create a page that only contains that <object> tag.
use javascript to remove everything else.
crop the final screenshot based on <object> page coordinates.
To use phantomjs from php, try php-PhantomjsRunner.
Edit 1: In case you only want to render a flash file that does not actually rely on the web page it is in, you can try Gnash according to the blog post "Server-side PNG rendering of SWF images using Gnash" by Valentine Bichkovsky.
phantomjs screen-scraping

Getting the final/timed render of a URL

I am looking for a way to, give a URL, get the source of a webpage back after the JavaScript has been run on it. For example:
I have a webpage with a .
On loading the page, some JavaScript populates the div.
Viewing the source of the page through a browser will not give the information which is within the div.
As far as I know, in order for the browser to render the page the div must have been filled with (X|D)HTML which would mean that the source of the page after being rendered is still just nested markup, so theoretically there should be a "final" version of the page source.
I have considered using a rendering engine like WebKit or Gecko and somehow adapting these to do this, however this is a fairly large task and I don't really want to duplicate something which has already been done. Does anyone know of a way of performing this task.
Regards.
Update: I am aiming to use Selenium (as mentioned in the comments to the accepted answer) to do this automatically for several pages. My project is a web spider which by design needs to target a number of pages in which the content I am aiming to reach is not available until after the JavaScript has populated everything.
Such addons for Firefox as the WebDev toolbar, or Firebug have options like 'View generated source'.
As far as timing it goes, just about the only option you have is to have a snippet of javascript code. You could set a start-time as soon as is possible on the page-load, and check again when the page is completed (either for dom-ready or page completely downloaded). It's going to be highly variable however, and if you are trying to time it in order to improve the speed (which is good to know, and to do) - just getting Firebug + Yslow would be far more useful.
Within Firefox you can get the final rendered DIV by waiting the browser to finish rendering, then pressing ctrl-A to select all content on the page and finally selecting "Show selection source" from the right-click menu.
This shows you the manipulated/populated DOM-code of the page.

Categories

Resources