Performing Calculations In A Webpage With An External Javascript File
Jan 13, 2006
I work for a small college and we were recently given permission to use a particular GPA calculator on their website. They sent us a javascript file, that I now have. I am trying to incorporate this into our website, but I don't really know much about javascript and I am having trouble making it work.
You can view the GPA calculator here to help clarify what I mean... If someone could just help point me in the right direction or if anyone know a site with tips that would be helpful to me..
Theres this situation where i have to place a js file (say myscript.js) on a client's website to do something on their page (like create a div element with some content in it). Now, myscript.js works when window or DOM has loaded. The problem is that the client will/may also have onload functions which will be overridden by myscript.js if i place it at the end of the page or vice versa if at the top of the page.
Theres one (albeit obstrusive) way in which it can be done. Create multiple onload function (Simon Willison's script) within myscript.js and call that function from the client's webpage.But i dont want to add any inline javascript code on the webpage. Just the external js (myscript.js) file should do. Is it workable to load my script externally and not add any inline call to myscript.js as well as leave the client's javascript onload scripts unaffected?
I got an [object error] from IE 7.0.5730.11 when moving the <script src="..." type="text/javascript" /tag from the <headpart to the <bodysection of a HTML file.
Is not possibile to include Javascript code via <script src="..." type="text/javascript" /from the <bodysection, instead from the <headone? If yes, anyone has any idea of which the problem could be? If not, how can I programmatically include a javascript external file inside the <bodypart of a HTML file, for example, using Javascript to some particular native functions?
I have an external .js file to my webpaage. Can i change the value of these variables from my htm page, so that they are changed for good.
ie - i know this wont work, but it is an example.
externalFile.js ------------- var alpha = "This is some text"
frontend.htm -------------- <form name="changer" method="get" action="externalFile.js"> <input name="alpha" type="text" id="alpha" value="this is some new text that will completely replace the old text in the file"> </form>
When I try to parse xml fixed string following code works fine. When I try to parse the string get from remote server.(bellow code example) It gives me an error unterminated string. I think this error is because of large string. Code:
I am having a project requirement of calling a Javascript from a java program or JSP. Here it goes...
I have an external web page which I can access using a hyperlink this page is "Export to PDF" page. In this page we have an "EXPORT" button which on click calls a "do_export" javascript function. On clicking the EXPORT button a PDF is generated.
Now my problem is I do not have the access to the code, so what I can do is to some how open that webpage and then execute that javascript function form a Java program or a JSP file or even a shell script file.
In simple, I want to automate this export process and I had only access to this webpage by a URL.
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]
</div> </div> </div><!-- End demo --> <div class="demo-description"> Fetch external content via Ajax for the tabs by setting an href value in the tab links. While the Ajax request is waiting for a response, the tab label changes to say "Loading...", then returns to the normal label once loaded. </div><!-- End demo-description --> </body> </html>
I'm writing a script and I've encountered a problem.. I have a txt file with many words, each word in a different line. For example: the file words.txt contains:
word1 word2 word3 word4 word5
I need to load the content of the file into a variable in my script. I prefer that all the words will be in the same variable with line breaks, but if you'll figure out a way to put it in an array, it's ok too. I really don't know how to do it, and I tried to google but didn't understand.. By the way, I don't want to change the txt file to js file, I need it to remain txt..
I have a external file for example abc.js ,in this abc.js file no functions ,it contains some scripting,i want to call the scripting file though html I use the code
I'm writing a script and I've encountered a problem.. I have a txt file with many words, each word in a different line. For example: the file words.txt contains:
word1 word2 word3 word4 word5
I need to load the content of the file into a variable in my script. I prefer that all the words will be in the same variable with line breaks, but if you'll figure out a way to put it in an array, it's ok too. I really don't know how to do it, and I tried to google but didn't understand.. By the way, I don't want to change the txt file to js file, I need it to remain txt..
Is it possible to use javascript to write information to a log file that's on an external site? What I want to do is have a person put their name and birthday into a form on my site, and then output that information to a partnering site's log file which would be something like www.whatever.com/whatever.file Is this possible? what file type can javascript write to? I put .file because I am unsure.
I have the following HTML file: --- <html> <head> <title>Test</title> <script type="text/javascript" src="test.js"></script> </head> <body> Hi There. <a href="javascript:doit()">Click Me</a> </body> </html> ---
The following js file: -- function doit() { alert("I did it"); } --
Running htm file locally (double click) gives me security warning (XP SP 2) but if I then select "allow script to run" everything works fine.
But when I serve page through IIS (localhost) I get a syntax error line 4 char 4. Of course there is no line 4 in the js file.
This HAS to be something simple I am missing but I have tried: - with and without language attribute in script tag - relative and absolute paths for the js file - with and without Mime type for js set in IIS
Only remaining thing I guess it could be is file permissions but everything has execute on it as far as I can see.
My company has a website where we have some case studies in pdf format . People can download or view them . Is there any way we can know how many times people are downloading or viewing pdf files on that web page through java script . Server side scripting languages is not enabled at the moment but javascript is.....
I am trying to call a javascript method on a page that is loaded into a div with ajax.I cannot get javascript functioncalls to work.And I don`t know why,that is when I run the page in its own browser window it works.Can I do it different to ensure it loads javascript?
im working on a web application that generates dynamic data. My question is: i want users to be able to save the generated data, but not the whole web page, just a table in the web page that holds this data. I searched and found out that showing a "save as" dialog box is possible with javascript, with a method like: onclick="javascript: document.execCommand('SaveAs',Ƈ',null);. However, i coulnd't find out how to change the document object (or is it possible?) or a trick to print just the table of dynamic data.
I tried to cover the table with <div id="myData"></div> and use onclick="javascript: myData.execCommand('SaveAs',Ƈ',null); but as you might guess, it didn't work and gave this error message: "object doent support this property or method". Indeed i dont have any idea what div tag can and can't do, so it was just a meaningless try. By the way, i want to add that i can't use iframes just because of program design issues. Anyway, do you have any suggestions?
I have web page where user can upload file. He can select which file to upload with standard HTML input of type file. I want to add this feature: when user select some file (e.g. picture, pdf etc.) in file select dialog, I want to add link to selected local file. When user click on it browser(maybe associated application) should open local file so user can review what he selected. I was experimenting with urls with "file" protocol but it works only with html file located on local computer not for one on web server. I found that this is because of security restriction in browsers.
i am trying to have the content of a txt file loaded in a page (which works), but this file changes on a regular basis and I need just the text to refreash, not the whole page, this is what I have... As mentioned, it correctly displayes the content of the .txt file, but from the code I have, I need it to refresh
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
it is possible to redirect content that would normally appear on a webpage into file instead. I have webpages that I want to be able to switch into LOG mode where the entire content is instead written to a file.
I have an excel doc. which is updated by many people through the day. I would like this to be converted to a web page every hour, and then saved to a directory where it can be pulled onto a website.
Obviously I'm not quite understanding .not() because the following code does not perform identically: if(!$(this).is('.current')) { some code } and if($(this).not('.current')) { some code } So that I can make use of .not(), how would I write the second conditional so that it performs as the first conditional?
http://livescore-bg.net/srpski.htmlI want when I change some of the menus 3 thing to happen in the folowing order:1) Old flag to hide()2) New flag to be on its place, IN THE MOMENT THAT this is not visible, I mean, in the moment in which the hide() action will already be performed.3) New flag to fadeIn()As you can see after some tests on the url shown, FIRST it replaces the flag, and after that it hides the old and shows the new one. Here is my first version of the code:
In practice you can't. While you could create a suitable encryption system with a password in the page, the level of support you need to do this means it's always simpler to do it server-side. Anything that "protects" a page other than the current one is definitely flawed.