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>
well i'm kind of new to this website and scripting with javascript but i am wondering: in a client side .js file i have some coding which results in a string which is stored in a variable called exportData
now i want that string to be written into a text file on a server but how do i do that? it is not local on the client's pc and i can't find how to do it anywhere..
What I want to do is create a HTML form that allows the user to enter data into about 10 fields, and then based on the entered data, writes out data strings to a text file. I am attempting to create a form for entering simple rectangle CAD data via a HTML form, which will be written to a text file, and then imported into a CAD program.
The form would contain prompt boxes for things like length, width, radius size, step/repeat, etc. When the user hits the "SUBMIT" button, the data strings would be written out to the filename the user specified. Below is an example of data strings to be ouputted. Variables are &L, &W, &R, &STEPX, &STEPY, &XN, &YN.
i'm having trouble writing to a text file with javascript, i've tried writing to a local text file on my own PC, and I've also tried writing to a local file on my own server, (which I have all permissions to do so...) I'd really like to write to a file that resides on my own web server. Code:
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?
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 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..
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with no luck though), and searched through the IRT.ORG Faqs (www.irt.org/script/script.htm).
The Javascript is designed to open an popup window and then inside that window call another script which will resize that window. There may be another way around this but the reason I tried this approach initially was that I wanted to call the onload handler in the popup window to resize the image only after the image had completely loaded. I've had some code in the primary Javascript file (showimage.js) before that works if the image has been cached but on the first load, it doesn't resize properly which tells me it is probably because it is trying to resize the window based on the image size but it isn't completely known at that point. So I removed that code and tried placing the resizing code in the second Javascript file (resizewindow.js). BTW I've tried other code to open a popup image and automatically size it ie Q1443 at irt.org but that doesn't do exactly what we need.
Even if there is another way to do this with one file, I still want to figure out why this isn't working in case I run into it in the future.
I thought what I would need to do to use document.writeln to write Javascript would be to escape any special characters and to break apart the script tag ie
document.writeln('</SCRIPT>');
would become
document.writeln('</SCR' + 'IPT>');
I have a HTML page and 2 Javascript files. All files are in the same directory and have permissions set correctly.
Here are the 3 files (keep in mind wordwrap has jacked up the formatting):
index.html ---------- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test</title> <SCRIPT type="text/javascript" LANGUAGE="JavaScript1.1" SRC="showimage.js"> </SCRIPT> </head>
<body> Click the house<BR> <A ONCLICK="newWindow1('house1.jpg','Nice House')"><IMG SRC="house1thumb.jpg"></A> </body> </html>
showimage.js ------------ function newWindow1(pic,sitename) {
resizewindow.js --------------- function resizewindow() { // Do resizing here. // Right now this isn't being executed alert("resizing window"); }
Can anyone provide some pointers as to why this javascript is failing? I'm using IE6 on Win2k and when I click on the image to open the popup window, it does open the window but it is white with no content and the system immediately goes from about 4% CPU usage to 100% and consistently stays there until I kill that window with the task manager.
i was searching for that script in this forum, but it seems to be lost or removed?
that script was kinda using activex or vbscript it writes a .txt or a file to be saved to a location in the hard disk... (it's not server-side)...can anyone repost that script?
i've learned how to retrieve Information from a xml file and display it in browser window.My question is, is it possible to write data into a xml file with jQuery?
Does anyone know if I can save part of a web page to a file on the users computer without saving the whole web page? I know I can print part of a web page using style sheets, will this work for saving also?
If not possible, can I use Javascript to program a button the end user can click to save data to a file on their computer?
I heard there is something called XMLHttpRequest that is compatible to all browsers. What does that actually do? Is there something to do with Javascript?
i have a widget which incllude html script, I am trying to send this widget to people that request it and allow them to use it in their own webpages....I am trying to figure out how to let the person enter information in the "form" and when they press the send button no screen pops up but the information is sent to a textfile in our public html directory....
I need a row of tickertape. Each character should appear on screen as if it were being typed, so that the entire row is scrolled left to right. Like a 'teletype' - I think they were called. 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..
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..
I have a form that posts data to a PHP mailer page I have created. When it goes to the PHP mailer page it reads some of the data and modifies the page accordingly using Javascript (hiding certain divs, etc...). My goal, is to take all this data after it has been processed by Javascript and send it through my PHP mailer as it is currently formatted.
If it helps any, the track I am on right now involves encapsulating the Javascript processed block in a div. I am then trying to take the ..innerHTML data from that div and store it in the PHP $message variable for my mailer. This won't work because PHP is server side. So, I moved on to generate some Javascript code (with PHP) that sends all that messy HTML data that its processed through a URL variable to then be read by PHP. This doesn't really accomplish what I want as it cuts off about a quarter of the way through my data......
Any ideas??
One thing I thought of but don't know how to do or whether it's even possible is using PHP to view the source of the current page and store that as the HTML to be e-mailed. Or, is it possible to do something similar to .innerHTML with PHP?
Firefox has a Javascript Console that has 3 panels besides "All" and "Clear": "Errors", "Warnings", "Message".
Does anyone know a way to log a message in the Message panel with JavaScript? That would really help debugging. I know there's a way involving XPCOM, but that only works with "trusted" scripts, and scripts loaded thru html aren't trusted.
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.
I'm having a bit of trouble understanding something that seems relatively simple. When I make changes to CSS in JavaScript using '.style' I'm changing the attribute values of inline CSS. Can I use JavaScript to change the attribute values of rules in an external CSS file? I have no CSS in my html and would like to know if I can grab the values of attributes in an external CSS file using JavaScript.
Now blah .jsp is included INSIDE index.jsp. In blah.jsp I have a button that calls a function inside b.js. In index.jsp I have following code inside head tags:
and I figured since blah.jsp is included inside index.jsp, I should be able to access the javascript methods with ease. But its not happening that way. I get an error (object expected in the line that has button in it). BTW, its not a problem in my JS or JSP code, because if I put the js file's contents inside blah.jsp, then it works like a charm!
So what am I doing wrong?
I also tried moving my script import statements inside blah.jsp as: