HTML Download Efficiency
Jul 9, 2007
I am curious to know if any research has been conducted regarding the
efficiency of having a single (large) .js file downloaded for a
webpage compared to several smaller .js files.
For example in my web pages I often include the scripting code
<script language="javascript" type="text/javascript"
src="ascript.js"></script>
which contains all the code for a given function, i.e. the main
function and any subsidiary functions.
I have developed a few library functions (leftString, rightString,
etc.) and these can be invoked by functions in other .js files, so I
would have something like":
<script language="javascript" ... src="libs.js"></script>
<script language="javascript" ... src="ascript.js"></script>
I'm just wondering if there is any difference in download time when
the HTML has to download these separate .js files rather than a single
one.
Even though the use of broadband is spreading I still like to keep my
web pages as efficient as possible, not everyone has broadband after
all, some still use dial-up connections.
View 3 Replies
ADVERTISEMENT
Jan 21, 2010
I've implemented jQuery within a web application where a very large number of DOM elements, comments in this case, are injected post-load by a 'Show all' button. Returned via JSON is a HTML string of <li> elements, to be injected into a pre-existing <ul> element. I'm looking to make this more efficient, as reading various sites I've been led to believe that wrapping new elements in a parent wrapper node before injecting would yield the best speed. Here, however, I'm injecting into an <ul> element that already has elements in, so can't wrap it.
What's the most efficient way of tackling this?
a) Wrap them in an element, inject, then unwrap and move into the target?
b) Clone the existing <ul>, add the elements in-memory and then replace in the DOM with the consolidated version
View 5 Replies
View Related
Dec 17, 2010
I'm trying to develop a form piece that has multiple radio buttons. Selecting a radio button will display a set of options relating to that radio button. Clicking on the label (which will be an image in this case) should do the same. I have the radio button part working and am having trouble with the labels. Clicking on a label selects the correct radio button... but the content for that button is not displayed. I know I can probably work around this in the same way I am addressing the radio button change events, but I don't want to introduce more code than I need. With that being said, I also know there has to be a more efficient way to tackle the radio button change events since they all do the same thing and only the value is changing.
Here's a stripped-down version of what I am working with. I'm looking for someone to help me make this work correctly and, equally as important, address the inefficiencies in my coding approach.
[Code]...
View 1 Replies
View Related
Aug 31, 2010
I'm a AJAX newbie, I was wondering if I can use the .responseText method, to load the text from other website? For example, how can I download the data from "[URL]" and display the data in my own way? It seems that the .responseText/.responseXML does not work here...
View 4 Replies
View Related
Oct 2, 2011
I am trying to create a way for my users to download some code dynamically from my web page via a file download. Below is the code that i have written so far. It seems to be dying on the iframe but i'm not sure why.
Here is my jquery trigger which is inside my onreadystate function.
$('#export_txt').click(function(e){
alert(LPAjax.ajaxurl + "/download.php");
$.generateFile({
action: "download_txt",
filename: "exportme.txt",
[Code]...
View 1 Replies
View Related
Apr 11, 2009
I need to have a submit input button automatically start a download when clicked, but also redirect to an additional "information" page. Since I'm not sure if this can simply be solved with HTML or must use some Javascript.
View 4 Replies
View Related
Jul 14, 2011
I have a page /download.php.basically on entry this page displays a browser download dialog box for a file.I was wondering if there is a way to use .load() to get the same download dialog box on another page.I tried the code below but it does not work/ what jquery function I can use to get this working
$('body').load('/download.php');
View 1 Replies
View Related
Dec 21, 2010
I am trying to get started using JQuery, but I find I can't even get to lesson #1. When I go to jquery.com and click to download the latest version (or any version) it doesn't "download" anything. It opens the file as a webpage in my browser and I see all the JQuery in one big string. Why won't the file just download? Is it the browser I am using? Is it my Mac?
View 2 Replies
View Related
Jul 23, 2005
I'm trying to script a download counter that will display the total
number on the download page without server-side scripting.
Below is my very incomplete beginning. It returns no errors, but does
nothing:
<script language="JavaScript">
function addClicks() {
total = "form1.value";
form1.value = (eval(total.value) + (1));
}
</script>
<form name="form1" method="get">
<p><input type="text" name="total" maxlength="4" size="4"> <br>
<input type="button" name="addition" value="Download"
width="10"></p></form>
View 8 Replies
View Related
Jul 23, 2005
CAn anyone tell me where to get previous versions of internet explorer
(for ecxample version 3 or 4)? I need it to test my javascript code...
View 3 Replies
View Related
Oct 14, 2005
Does anybody have a Download Dialog written in JavaScripts? This is for a website. I've seen it done before.... where you click on what you want and the dialog comes up asking you if you want to save it. From what I can tell, the name of the file is passed as a parameter of the JavaScript.
View 6 Replies
View Related
Aug 17, 2006
I'm using ASP.NET and setting window.location.href in my web page to output an audio file that the user is prompted to download. I would like to provide a link so that the user can download the audio file and an XML file one after the other. I've been experimenting with opening a new
window, but there must be a cleaner way of doing this.
View 1 Replies
View Related
Sep 13, 2006
My objective is to redirect to another web page after download is
complete.
I have an activeX called to download a few dlls using the following
code
document.writeln(' <OBJECT ID="MQC" ');
document.writeln(' CLASSID="CLSID:98c53984-8bf8-4d11-9b1c-c324fca9ca"
');
document.writeln(' CODEBASE="test.ocx#Version=9,1,0,4359"');
document.writeln(' WIDTH=100% ');
document.writeln(' HEIGHT=100% >');
document.writeln(' <PARAM NAME="DomainPassword" value=""');
document.writeln(' <PARAM NAME="RootURL" value="' + getTdRootURL()
+'"');
document.writeln(' </OBJECT>');
I tried redirecting in the onLoad event of the form but doesn't work. I
suppose it redirects as soon as the activeX is loaded and not when it
has finished its download.
View 1 Replies
View Related
Jul 20, 2005
I am trying to allow a user to view a PDF in a new window. I currently have this working using the following:
<a href="./pdf.do?parameter=01121980" target="top"><b>pdf</b></a>
The problem with the above solution is the back/forward buttons and all the other browser options. Because of this, I am trying to get the following solution to work:
<a href="#" onclick="popUp('./pdf.do?parameter=01121980')"><b>pdf</b></a>
function popUp(url)
{
window.open(url, "PDF",
"width=500,height=500,status=no,toolbar=no,menubar= no");
}
When I use this implementation, I get a window asking if I'm sure I want to download the file (which I do not get from the first implemenation). I click yes, and it says it was unable to download the file. Just as an experiment, I have taken the url that ends up in the location bar from the working method and pasted it in a new browser window. That gives me the same error as the popup function method.
View 3 Replies
View Related
May 21, 2010
How to download a pdf link? suppose we have a pdf url [URL] now i have to create a button on click of which it downloads that pdf. i have tried window.open() method in javascript but it opens it in another window. is there a way to download a pdf link using javascript or ajax.
View 3 Replies
View Related
Jul 23, 2005
I would like to design a page that measures the user's download
connection. Does anyone have an example link or script that might aid
me in this task?
View 4 Replies
View Related
Nov 23, 2005
I need to download - randon size - parts of a file, not the whole file.
Says: I have the zip file test.zip, it is 10 mega bytes long. But I
don't want the 10 mega today. Today I want 5 mega bytes. Tomorrow I
could want more 3 mega bytes of the file, but it is not sure, could be
4 mega bytes. I need to part the zip file in chunks at request. No CGI,
no asp, no php. Only client side scripts.
View 5 Replies
View Related
Jul 20, 2005
The script below allows me to link to a file and as the user clicks to
download, the 'File Download' windows appears as normal, and the user can
download...
The original page is then redirected to a new page..
This works, but it also opens a blank page..
How can this be chaged to stop the blank page from opening... ?
<script type="text/javascript">
function functionname(thefile){
document.location.href="somepage.html"
newwindow = window.open(thefile)
newwindow.close
}
</script>
<a href="#" onclick="functionname('filename.zip')">wqe</a>
View 3 Replies
View Related
Jul 20, 2005
I have several PDF files that I want folks to read. Should I just write
some text and make a hyperlink to the file. I'm still trying to decide if I
want them to only open the file and read it or force them do download it.
View 1 Replies
View Related
Sep 27, 2010
I want to download BeautyTips. I go to [URL].... and I get to what appears to be an appropriate page.However, I can't find anything to click that seems to result in a download.
View 1 Replies
View Related
May 6, 2011
I do not see a link that would allow me to copy the documentation. I want to have it local so I can work disconnected from the 'net. Spidering the tree off the website seems a bit much. Did I miss it?
View 2 Replies
View Related
Dec 9, 2009
i want to bring image download link to download a single image using like
<a href="./images/sam.png">Download</a>
when i click the download link it need to download plz help how can i downloadcan finished
View 1 Replies
View Related
Feb 24, 2011
i noticed today that if i type in my js file name in the url i get a download box, i have an htaccess on my site so this should not be happening, thats another issue.. my question is, is there a trick to creating a js file that cant be accessed in this manner, i was thinking about adding a php define statement as it comes from one source only, but i wanted to ask first to see if there was something on the js side i could do or is that strictly a htaccess or server side issue..
View 2 Replies
View Related
Mar 4, 2009
I website I've seen recently uses a clever technique, which I'm still working to figure out. When you go to view an image, a pop-up window opens -- the image is downloaded (non-cached) and then some javascript (presumably) loads a replacement image in its place (it's not displayed) -- when you go to save it, you get the dummy image.
Further, they make some javascript call (presumably, or jquery) to replace the document content of that page, so when you do a View Source, you get something totally different.
How this is actually working, and whether something like that could be cross-browser supported.
View 8 Replies
View Related
Oct 31, 2009
I got a contact form written out and it is working and it was integrated from this site:Download link at the bottom to whoever needs it. and I integrated it into my site:But how can I set it so once someone successfully sends a message, the textareas get automatically erased?
View 1 Replies
View Related
Jul 13, 2010
I have a problem, say that I have a lot of diffrent websites, and that those are on diffrent webservers, now also say that I want one specific objekt on all those websites, is it possible to write a javascript that gets that object from another webserver?
Code:
function getElementFromAnotherSite(){
/*Download www.example.com/images/example.gif
[code]....
View 5 Replies
View Related