What's the simplest way to fetch a js file from the current website, then
cache it?
I'm using dojo, which has a large js file when using the built version.
As a mercy for dialup users, I want to serve up a tiny 'loader' html page
(containing an animated 'loading...' gif) which, when loaded:
1. retrieves the big js file, and plants it in the cache
2. when the js file is retrieved, then sets document.location to
the url of the real website page which uses this js file, and
thus redirects to that page.
Working on a little window to do some very simple quick edits to an external CSS file. Whole thing is working off of Ajax URI strings and GET methods.Once a edit to the loaded CSS source has been performed I write back out the the external css file via Ajax GET method and PHP fopen. Then while the file writing completes, I return back its newly saved contents to the head of my document.In my documents head I have a div block with a unique id that gets traversed to via DOM and our newly edited external css files contents gets dumped too.Upon dumping the contents of the external css file to this div block I wrap style tags around the incoming contents like so.
Ok great so that's the break down of my whole editing and updating preview of an external css file, now my problem. Works fine in FireFox and not so well in IE.I suspect its because IE caches CSS harder than the FF Gecko Engine. Thus leaving me here to ask if anyone knows of a work around for my approach or a more elegant method that I might want to investigate?
I am looking for a way to select a file from a list and load it into a webpage. The page and the files are stored on a sd-card for off-line usage, I know that listing files remote dynamicly needs a scripting engine but since the sd-card is on the client side that is not possible, but I can make a list of those files when creating them.
It is intended for a datalogger on a tractor-puller, I create csv files with a bash script on the logger and for off-line viewing I use a javascript charting engine which loads the csv file, the files have the creation date as filename and I can make (and maintain) a list of files when creating them. The plan is that the we can select another data set (run) from within the browser and show that one. I have setup an example at [URL]
i need jquery to load for 3 tables from different php files without leaving the page , and table links on the bottom . So , onclick , links will load those external php files without leaving the page . Here;s a example of what i need :D
I'm currently working on my portfolio website and would like to have information about my movie clips be retrieved from an XML document when a thumbnail is clicked. I am building my website in HTML and would like to retrieve the Xml using JavaScript.
I'm a newbie trying to modify the code in an AJAX tutorial to load data from an XML file, and it is not working. The code is in a php file that is invoked with the URL:getXMLTest.php?showName=photoShowTest.xml The code I've written (mostly copied from the tutorial, actually) is:
I am writing a mailing list app in PHP, the thing is I have a folder which will contain templates, is it possible to load the users template selection (say by clicking a radio button) into a textarea or iframe.
I need to load a file with a javascript variable. I am trying to provide a method for a vertical javascript scroller to be updated by nonprofessionals, so i decided to have the text in a external file that can be updated
<script src="js/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script> <SCRIPT LANGUAGE="JavaScript"> //-- Begin Scroller's Parameters and messages -->
What I mean by this is how do you load an xml document that has been inputted as a string in a form. I would've assumed it was something like this, but this doesn't seem to be working.
<html> <head> <script type="text/javascript"> function loadXML(file) {
i was wondering if it is possible to load text into a string from an external text file. the reason is that i have a very large string and it is making my script very messy.
also, is it possible to have some dynamic parts of the text from the text file? for example, if i load in a string and there is a part of it that inserts a value from a variable like the following:
'The number of people is ' + var_people_num;
....so the text from the external file would load but these parts would be given the value of a variable contained in the script that calls the external file. its not absolutely crucial that i obtain this but it would help me seperate large chunks that complicate the script.
As we all know, JavaScript is client side and php is server side, (the php code is 'allowed' to do stuff on the server that JavaScript cannot). The problem with php is that it timeout after a while, (and the user also has no clue as to what is going on for a long time).
I need to run a script on the server that could take a very long time.
So what I was thinking is mixing both JavaScript and PHP Something like,
<script> var endvalue = 1000; /* some number that the server can calculate quickly */ var i = 0 while (i<=endvalue) { /** call a php file that will do some work somefunction.php?someNumber=i */ } </script>
That way the server does the work, while the client keeps it going. Ideally I would also get a return value/string from the php script.
I have a JS file on site A which needs a few parameters from a short text file on site B. Since crossing domain boundaries in JS is problematic, the way I do it is that the JS actually opens an intermediate PHP file on site A which redirects to the destination page in site B. Here's how it goes:
The call is made through code...
The problem is that this takes a long time. I would really like to speed this up. For example - I thought of using a direct IP address, so that there won't be any need a DNS server (using Code...
) but this would expose me to hackers as it would make my Hostgator username visible. According to HG support the above format is the only way to access my subsite via direct IP.
Any ideas on how to speed this up, either by bypassing DNS (but without exposing username) or by offering another way of reading data across sites?
I'm building a home page with an update checker. A function, called 500 millisecs after the page loads, appends an external .js file and compares a variable on it to a different internal variable. If the internal variable is lower than the external variable, then the update prompt is displayed.
This all works fine, but the status bar says "Read www.primedesigning.com" (the site with the external js), or sometimes "Transferring from www.primedesigning.com". But, if I hover over any link, the status bar goes back to "Done". Also, if I leave my mouse still, wait for the update prompt to appear, and then move the mouse, the status bar says "Done".
I have the Fasterfox extension installed, and it confirms what the status bar is saying. It never stops loading unless I do 1 of the 2 solutions mentioned above.code...
I want to put some additional checks while loading the file for that I need to check where each line contain the "|" symbol or not which I am using as a file delimeter.Can anyone tell how can we read the file line by line in javascript.
I have a JS file on site A which needs a few parameters from a short text file on site B. Since crossing domain boundaries in JS is problematic, the way I do it is that the JS actually opens an intermediate PHP file on site A which redirects to the destination page in site B. Here's how it goes: The call is made through:
I have some code that performs differently in Opera than it does in any other browser. So I have a stylesheet specifically for opera. Is there a way to do something like this, where I check the browser, and if it's not opera, then load the default sheet, otherwise load the opera-specific css?
<script> // Browser Detection Javascript // copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd // You have permission to copy and use this javascript provided that // the content of the script is not changed in any way.
[Code]....
As of this writing, that code seems to break my page, as if it doesn't like loading a sheet based on an if/else clause.
I'm currently working on a site and need to have a small section that displays 5 or 6 headlines. The same headlines will displayed on various pages and will occassionally be updated.
The site pages are static .html in design and i'd prefer to keep it that way rather than start introducing php for such a minor part of the site.
I am wondering if there is a javascript solution to this, whereby the headlines could be loaded via a .txt / .xml document or something similar?? That way i could just manually update the file and reload it to the server and the headlines would be updated.
I guess i'm think something similar to cushyCMS but that i can implement directly.
A program I am writing will be loading the data of a file into an array. This data is read as an image and is displayed. Part of it will be the modification of palettes, so if I click Palette 4, it would go in and edit the array to have new contents (predefined by me) and redisplay the image in place of the one that was there before. How would I load a file into an array and display it as an image and stuff?
I have set of html pages that are installed locally on machine. I want to make ajax call to local files. In Firefox everything works fine. IE is able to load html pages through ajax call but not able to load xml document.
Chrome doesn't support ajax call locally...and I don't care about it. I need it to work on IE & firefox.
I'm fairly new to jquery so apologies if this is a very simple question with a very simple answer, but I just can't figure out the solution. I have an overlay div, and when I close the overlay I want to remove the html inside it and then re-load it from the specified file. I have already worked out how to empty the div, but what I now want to do is re-populate it with the content from a separate file on my web server.
The links at the top load XML/file/content into the DIV. This works ok.I then want the images (from 2nd link) draggable to the right hand menu. It doesn't work.However if I select everything, view source code, save the file and view it (http://9publishing.co.uk/ test/ xml /jquery/jj.asp ) it works fine!
P.S. The code that loads the content into the DIV is:
javascript Code:
var xmlHttp function showCD(str) {[code].............
how to load an XML file into a DOM. I can get it done in IE, but in mozilla I am missing something. Here is what my loadXML() function looks like:
function loadXML(){ try { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.onreadystatechange = verify; hasFile = xmlDoc.load(info.XMLDocument); if (hasFile){ xmlObj = xmlDoc.documentElement; allTopics = xmlObj.getElementsByTagName("topic"); }} catch(e) { xmlDoc = (new DOMParser()).parseFromString(document.getElementById('info').innerHTML, 'text/xml'); hasFile = true; allTopics = xmlDoc.getElementsByTagName("topic");
if (hasFile){ allTopics = xmlDoc.getElementsByTagName("topic"); alert(allTopics[0].firstChild.getAttribute("name")); }}}
Where verify is another function. The try part works for IE, but the catch part doesn't work for Mozilla. I am not finding any information as to really use an XML DOM properly in Mozilla. I'm trying to get allTopics to be a handle on the same thing in both the "try" and the "catch".