How To Compile .js Files

Jan 13, 2011

I'm totally new to javascript world and i'd like to learn by writing simple examples and running them, my problem is i dont know how to do that, how can i compile/interpret .js files and see the results and the errors.

View 2 Replies


ADVERTISEMENT

How To Compile Multiple Files

Aug 24, 2011

I would like to use a compiler to minifier my JS code. The JS code is separated over multiple files. For example, I have a language file (lang object), init.js files, common function files, ... here and there I even use global variables. I would like to use a compiler which also renames variable names to reduce JS file size. However, when the variables are separated over multiple JS files, and you compile each JS file one by one, the same short variable names will be attached given errors in the whole application.

View 3 Replies View Related

JQuery :: Compile A Link From Form Input Values?

Dec 8, 2011

Is is possible to compile a link from form input values? Basically I need to compile a url string to fake a CMS search. It's a crude solution but I have no other options at this point.

So, the user fills this in an clicks submit which takes them to whatever url it has complied.

The url is quite complex but consistent, the resulting values will be at certain points in the url

So... http://somesite.com/search.php?categoryid=435834y59?keyword=KEYWORD VALUE?catalogue_number="CATALOGUE NUMBER VALUE"?price_from=PRICE FROM VALUE?

etc

<label for="keyword">Keyword</label>
<input type="text" name="keyword" value="" id="keyword">
<label for="catalogue_number">Catalogue number</label>
<input type="text" name="catalogue_number" value="" id="catalogue_number">

[Code]....

View 4 Replies View Related

Can I Collect Players Data From A Site Then Compile It Into A Rank

Feb 2, 2003

collecting players name and it will make a rank/tables by itself.Theres a link for each players of course but i dont remember ALL of them :P.its like manipulating the stats and compile a rank.

View 1 Replies View Related

Ajax :: Error: Attempt To Run Compile-and-go Script On A Cleared Scope

Jul 15, 2011

I'm getting the following error: attempt to run compile-and-go script on a cleared scope [Break On This Error] if (xmlhttp.readyState==4 && xmlhttp.status==200)

when i try to run the following code in mozilla firefox:

gethint.html

<script language="javascript" type="text/javascript">
function showHint(str)
{

[Code].....

View 3 Replies View Related

Mail Service - Attach Some Excel Files Of Text Files And To Send It

Aug 16, 2010

I have designed a mail service in java.In my compose page,i want to attach some excel files of text files and to send it.After sending i want to store it my database.Then how can i download or open that file after opening that recipient mail inbox.

View 1 Replies View Related

XMLHttpRequest Script - Works For Local XML Files But Not For External XML Files?

Oct 2, 2010

I have the following JavaScript (see below). The script requests an XML file from the server and displays it on the page.The script works fine when the requested XML file is stored on the same server as the script.The problem is when I try requesting an XML file from an external server such as the National Weather Service. I get an error. If I take the XML file from the National Weather Service and save it to my server it works. Why can't I use my script to request XML files stored on external servers?

Javascript Code

Code:

window.onload = initAll;
var xhr = false;
function initAll() {
document.getElementById("makeTextRequest").onclick = getNewFile;

[code]....

View 6 Replies View Related

JQuery :: Ajax Request Works With .xml Files But Not .php Files?

Aug 27, 2010

In my quest to implement ajax for the first time i've hit a brick wall. i've been searching for hours for a solution but with no success. Here is the problem.

[Code]...

why is it not working? my PHP code is outputting the contents of the xml document.

View 1 Replies View Related

List All Files In A Folder Including Subfolder Files?

Sep 5, 2008

I want to write a javascript to list of all files in a folder including files in the subfolders. This is for the scorm purpose to list all the files. some examples are listing files but not listing the files inside the subdirectories. I want the file's full path like C:Documentsjavascriptwilson.js like this.

View 5 Replies View Related

JQuery :: Firebug Shows Error "attempt To Run Compile-and-go Script On A Cleared Scope"

Apr 25, 2011

Using FF4 I keep getting the above mentioned message. hats is this supposed to mean???The scripts seem to work correctly, nevertheless.

View 1 Replies View Related

Show Images From Four Files - Each Files Are In Each Folder?

Jan 15, 2010

I have four folders and each folder has one images, let say ( images-one.jpg, images-two.jpg, images-three.jpg, images-four.jpg). now,in index.php page there are four buttons, each buttons for each images. if i clicked button numer two for images-two.jpg, and then it will show that images name from that folder in index.php page. and then if i reload same index.php page or refreshed same page, i want to show SAME images that I clicked before which is images-two.jpg. how can i write that code to show images from four files, each files are in each folder.

View 1 Replies View Related

Multiple Language Files - Use PHP Language Variables In Files?

Jan 9, 2011

What is the correct way to work with multiple language JavaScript files? So how to use your PHP language variables in your JavaScript files? The way I do it now is create JavaScript files like 'script_js.php' like this:

[Code]...

View 10 Replies View Related

How To Include Html Files In Html Files

Aug 27, 2009

The problem is, I might want to change the html I include based upon variables passed between web pages.My problem is I don't know how to include html files in html files using javascript! How would you do this?

View 1 Replies View Related

SWF Files

Jun 14, 2007

I have some Flash SWF games on my website with advertising banners on them.
People access a certain game by going to
http://www.mysite.com/flashgame.htm. With IE no problem. But in Firefox they
can type in http://www.mysite.com/flashgame.swf and bypass my banners. The
banners help pay for me hosting these games.

Is there a way with javascript that I can tell when they are going directly
to the swf file instead of going to the htm page? And redirect them to the
htm file?

View 6 Replies View Related

.eml Files To .xls

Jan 13, 2006

I need to change like 500 .eml files to .xls files.

Is this even possible?]

View 2 Replies View Related

How To Use Other Files In JS

Feb 6, 2006

In lets say I have an HTML document that has this in it:

<script type="text/javascript" src="file1.js"></script>
<script type="text/javascript" src="file2.js"></script>

I am trying to use a function that is defined in file 1 inside file 2. Its not working because its telling me that the function is undefined. Is there any way to make one file "see" the functions inside the other file in javascript?

View 5 Replies View Related

Writting Files

Oct 20, 2005

I have a question. Is it possible to write a text file using JavaScript?

View 2 Replies View Related

Posting To 2 Different Files

Apr 22, 2006

I have a form, which has a user and password, that a user enters

when i want to submit this form....

i would like to submit it to 2 two different files.

so file1.asp would have user and password....and file2.asp would have
user and password.

i would like two different windows to open, if possible. so the user
can work on both windows at once.

window 1 = file1.asp
window 2 = file2.asp

View 13 Replies View Related

Uploading Files With IE

Jul 29, 2006

I'm writing a class that will enable the user to upload files to
the server without reloading the current page (using target="iframe"),
and it works just fine in Firefox, but when I test it in IE, first of
all, the iframe is not targetted at all, and IE stupidly opens a new
window, second the <input type="file" element looses it's name
attribute for some reason... I tried using DOM and assigning the
element thru innerHTML, both will just not work in IE (and will just
fine in Firefox). Those interested to have the source code (commented
in french) may just ask me. But if anyone had similar problems, and
would want to share with me, I'd really much appreciate, because this
is driving me insane!

View 2 Replies View Related

Including Files

Aug 31, 2006

This seems like a really stupid question. Can you include a javascript
file in a javascript file?

Rather than doing this:

<script src="A"></script>
<script src="B"></script>

I want to do

<script src="A"></script>

and then have in script A:

include("B");

where include is a magic word that includes the file B.

View 1 Replies View Related

Files And Checksums

Jul 20, 2005

Is it possible to have JavaScript do a checksum of a file a user has
chosen to upload via a multipart html form? I'd like have JavaScript
do a checksum on the client side, embedded the result in the form, and
then have a CGI on the server check to ensure the server-side checksum
matches the client. Is such a thing even possible?

View 1 Replies View Related

Writing Files?

Jul 20, 2005

I there any way for javascript to write/manipulate a file other than through a cookie?

View 1 Replies View Related

Files With The .js Extension

Jul 20, 2005

I have recently bought the book: JavaScript & DHTML Cookbook. As I
opened the .js files with note pad, I asked myself why was the code
formated in such a way. The code looks as if it had been produced by
some kind of programs instead of a person. I also noticed a lot of
little squared zeros; what are those all about?

I have also noticed code formated in a similar way, when viewing some
of the source code of the web pages on the MSN web site. If someone
knows anything about this machine-like formating, I would love to hear
from you.

View 3 Replies View Related

Just One Of Several .flv Files Not Playing?

Jun 15, 2009

my website [URL] has been left unfinished by my friend and it doesnt look like he can finish it now. I have some understanding of code and have manually edited the existing pages in notepad to fix some issues. The one issue I have left is on the javascript samples player which overlays the main screen. I have all of the files (an flv and swf plus a folder full of js and a vbs file). As you will see, the morning chapter does not play but all of the others do. I have checked the flv in a player and it works fine, and it was created in the same way as the others. All flv and swf files are uploaded correctly I just can't work out why it is not working.

View 9 Replies View Related

Merging 2 CSS Files

Feb 16, 2011

the best way to merge two css files?

View 5 Replies View Related

Virtual Files!

Jun 21, 2007

This function will produce a URL that appears to be a file.

There are two versions:
1. a 500-pound gorilla version that accepts almost anything as input.
2. a lightweight version that turns strings into virtual HTML files.


First I'll mention the one major drawback: IE doesn't recognize data urls (http://en.wikipedia.org/wiki/Data:_URI_scheme) yet.

For a Live Demo, paste this into your addressbar and click go. (press back to return).
data:text/html;charset=utf-8;base64,PGI+aGVsbG8gd29ybGQ8L2I+
//output of: dataUrl("<b>hello world</b>", "text/html")

With that out of the way, here's the code:



function dataUrl(data, mimeType){ // turns a string into a url that appears as a file. (to ff/op/saf)
encType= (!!btoa) ? ";base64" : "";
var esc = (!!encType) ? function(d){return btoa(d);} : function(d){return escape(d);};
if(!mimeType){mimeType= (data.nodeName) ? "text/html" :"text/plain";};
b="data:"+mimeType+";charset="+document.characterSet+"+encType+",";

if ("string number date boolean function".indexOf(typeof data) > -1){ b+=esc(data.toString()); return b; };
if ( data.constructor==Array){b+= esc( data.join("") );return b; };
if(typeof data=="xml"){b+=esc(data.toSource()); return b;} //FF2 xml frag/doc
//for more complicated data, attempt to determine the format.
if(typeof data=="object"){
if(!!data.value && !!data.value.length){b+=esc(data.value); return b;}; //input tags w/content
if(!!data.innerHTML){b+=esc(data.innerHTML); return b;} //HTML tag
if(!!data.length){ //weird stuff like nodelists
var G=function(ob){r=[]; i=0;
for(i;i<ob.length;i++){
if(dataUrl(ob)) r=dataUrl(ob[i]);} return r.join("
");};//end g
return(b+G(data));}//end if object w/length
if(!! eval(data.toSource()) ){b+=esc(data.toSource()); return b;}; //JSON
}//end if object
return;
} //end function dataUrl

function dataUrlStr(data){ return ("data:text/html,"+escape(data));}



Usage: dataUrl(data, mimeType)
data- The desired contents of the file
mimeType- The type of content you want the browser to see.

output: An encoded string representation of the file; an href.
The output 'file' could be any text-based file format, depending upon what you set mimeType to be:
-HTML document (yawn) (text/html)
-Rss feed (text/xml)
-M3U playlist (audio/mpegurl)
-Excel spreadsheet, CSV (application/vnd.ms-excel)
-JavaScript (text/javascript)
-StyleSheet (text/css)
- You get the idea...

Input Details:
-Can accept [I]almost any javascript type: strings, numbers, arrays (which it will flatten), nodes, node lists, xml objects in FF2, functions (for which it outputs the source code), complex JSON objects, and dates. (whew, I think that's all of 'em...)
-if you want to output an element as html, or anything else as text, you can skip the mimeType argument.

Notes:
-You will most likely want to assign the output to a link href or the .scr of a script, stylesheet, or iframe, or to window.location.href.
-If you assign it to an iframe or object, it will load immediately.
-assigning it to a (<a>) tag will let you 'right-click, SaveAs' the file.
-clicking the link will open the 'file' in the browser just like a regular file.
-output an html document that has scripts, and they execute immediately.
-the cool thing about this is that the script will have a clean context. (no global variables from the parent).
-if used in an iframe- it can push to main page via window.top .
-if used in with an <object>, it will be completely private.

Caveats:
-doesn't work with IE yet.
-'saving As' doesn't offer a default file extention.
-there is 2kb limit for safari and opera URLs.
-search engines cannot see the links.
-XmlHTTP Requests from within usually don't work.
Examples:
To save my fingers, I will utilize the follow shortcut functions in these examples:

function el(tid) {return document.getElementById(tid)};
function tags(tid) {return document.getElementsByTagName(tid)};


//test
tags("a")[0].href=dataUrlStr("<b>Hello World!</b>")

//make a 2D array into an Excel SpreadSheet - (works with 1D lists also)
var grades= [["Subject" , "Grade"],
["Math", "A" ],
["English", "B+" ],
["Gym","C" ],
["Art","A-" ],
["Science","A+" ] ]
var exl=grades.join("
").toString().replace(/,/g , " ")
window.location.href=dataUrl(exl, "application/vnd.ms-excel")
//note: if data contains commas: loop through main, .join(' ') each index.


//execute script in a fresh enviroment:
window.testme="123456789"; //make a new global
var testJs="<script>alert('hidden window.testme='+ window.testme )</script>";
var fr= document.createElement("iframe");
fr.id="hiddenframe";
fr.style.display='none'
document.body.appendChild(fr); //add a hidden frame
alert("main window.testme="+window.testme);
el("hiddenframe").src=dataUrlStr(testJs);


//re-using the above example, pass existing functions to the hidden frame, and return the result.
var tJs="<script>";
tJs+=[tags, el].join("
"); //bundle a couple functions
tJs+="
alert('hidden window has '+tags('*').length)"
tJs+="</script>";
el("hiddenframe").src=dataUrlStr(tJs)


//open a playlist
var plTxt="#EXTM3U
#EXTINF:202,Minuet in G
http://www.mfiles.org.uk/downloads/beethoven-minuet-in-G.mp3"
el("hiddenframe").src=dataUrl(plTxt, "audio/mpegurl"


//open all the 'code' on this page as a plain text document.
function ob2Array(ob){var r=[]; for(var z=0; z<ob.length;z++){r[z]=ob[z]};return r};
function group( List, f) //applies a function (f) to an array and returns result...
{var z=0; Ray=[]; len=List.length;for (z;z<len;z++){Ray[Ray.length]=f(List[z]); }
return Ray;};
var codes=group(ob2Array(tags("pre")), function(x){if(x.className=="alt2")return x.textContent});
window.location.href=dataUrl(codes)


//make this thread into an rss feed
function tag(nd, tx){ return ["<",nd,">",tx,"</",nd,">"].join("")}
function dp (s) {var d = new Date();d.setTime(Date.parse(s)); return d.toUTCString()}
var X=PHP.htmlspecialchars
var chan=[]; var y = new Date();
chan[0]=tag("title", "CodingForums.com");
chan[1]=tag("link", window.location.href);
y.setTime(ajax_last_post+"000")
chan[2]=tag("pubDate", y.toUTCString())
chan[3]=tag("link", "http://www.codingforums.com/")

var codes=Group(ob2Array(tags("table")), function(x){
var i=[];d=""; p=d; t=d; l=d;j=d;a=0;
if(x.id.substr(0,4)=="post"){

p=tag("pubDate", dp(x.rows[0].cells[0].textContent.replace(/-/g, "/")));
t=tag("title", document.title)
l=tag("link", "http://www.codingforums.com/showpost.php?p="+tags("table")[5].id.substr(4))
ta=x.rows[1].cells[0].getElementsByTagName('a')[0]
a="<author>"+ta.href+" ("+ta.textContent+") </author>";
d=X(x.rows[1].cells[1].textContent.toString())



j=[d,t,p,l,a].join("
");
return tag('item', j)
}//end if
});

tags("a")[2].href=dataUrl(tag("channel", chan.join("
") + codes), "text/xml")


So, i think that should be enough examples to get going.

[I]"The only limitation is your imagination"

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved