Basically I want the document.write(document.applets[0].getLHost()); to display as the value in the form field. But when I try this it literally displays the code.
I want the form to hide the bottom two fields and display one or the other depending on what the nature of the enquiry is. Is there some HTML/ Javascript code that does this and can anyone point me in the right direction.
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.
Usin a JavaScript write a script that inputs five numbers and determines and outputs HTML text that displays the number of negative numbers, the number of positive numbers, and the number of zeros input. Code:
On the time sheet page i have created a years worth of entries in the database for a user so that they may create entries ahead of time(for holidays etc.).
My problem is that when i load the page, i display the current month for that user and it displays:
Date Month Day TimeInMorning TimeIn Evening etc..
What i would like is that a user may update any field and click on a save button which will update the field(s) that they have changed. I ahve attempted in javascript to do this but i am failing.
I'm trying to select data from a database and put it into a javascript ticker. The data is inputted by visitors using a form. The problem is the javascript wont run when the data has <br /> in it.
var marqueecontent='<?php echo "".nl2br($row["EventText"]).""; ?>'
Im using a php simple cms program which allows me to use templates to format my content.
I need help in stripping out (removing) the generated <img src="url"> tag when i insert image. I want to use javacript so its post processed (after the server has interpreted the php code) because I only need to do this in one category of my content.
I need some help with Javascript and HTML entities. I am writing some code and I need to use quite a few HTML entities on alert boxes (messages in different languages)
Unfortunately Javascript displays the entities and not the equivalent caracther.
I am looking for a package i found once that created excel style html tables with javascript. It would do all sorts of things like column resizing, sorting, rearranging etc.
I don't remember the name but I am sure there are similar packages like this. Anyone have a list of links?
1. I have a web browser component that does not support Javascript (well it does, but we've disabled it) 2. I have to display some HTML in it, where the user has a link titled "Hide|Show Options" that can hide/show a particular section of the HTML.
I have not found a way to achieve it without using Javascript or any other scripting language.
I'm having some trouble naming variables in javascript. Actually, my html has multiple form names (form, form1, form2, etc..., and im just having trouble understanding how to access elements within.For example: I get error:Message: 'document.forms.form.bname' is null or not an objectWhen I use the following code:
var bname = document.forms["form"].bname.value; And when I try this: var bname = document.form.bname.value;
I'm having some trouble implementing a popup in firefox. I attached some simplified code at the bottom. This is part of a firefox extension. What happens is that a popup window is created, the popup window updates it's data depending on what is shown on the main window. The problem comes when i click the 'X' to close the popup window. it crashes firefox, and closes all firefox windows. can somebody help me with this? why does this happen? I'm 99% sure the error comes from the form in the html code.
I'm trying to use client side JavaScript from an HTML file to open and make changes to an Excel SpreadSheet using ADO w/ ODBC. What a pain it is to do this. Anyways, I am able to open the excel file but I don't know how to use ADO to work with it's contents. So far I have the following code that works:
<html> <script> window.onload = function () { var ExcelSheet; var sConnect = "DRIVER={Microsoft Excel Driver (*.xls)};DBQ=P:js-test.xls" ExcelSheet = new ActiveXObject("ADODB.Connection"); ExcelSheet.Open(sConnect); } </script> <body> =) </body> </html>
Now that I have the sheet open, how do I manipulate it?
do you know if it's possible to call a python script in html page?? I want call my script pyhton and I have a html with javascript but I don't know how, do you have an example??
For a project I am working on, I need to retrieve links from html documents. The easy part is to obtain 'plain' links like <A HREF="http://site/path/document">, but when those links are javascript'ized, the only robust solution needs to load the javascript and dom document representation in the same way that browsers do. For example, links in the form:
First I though that using spidermonkey (the mozilla javascript interpreter) should be enough, but in that case, I dont have the document structure elements (like document, window, document.history, document.form.element, etc), so I tried parsing the document using a library to build a tree representation of it, but that leads me to the same problem again, that is, I have to represent all tree nodes as javascript entities.
Anybody here have worked on a similar problem? What tools do you think I should take a look?
I'm writing a program on Zimki, which I think uses SpiderMonkey as a server side Javascript engine.
My idea is to have an html file that someone else created, and look inside for cells in a table that have special known names, like name, description, etc. Then I want to figure out the <tr<tr/pair that encloses all of those special tags, and use that as a template to generate a bigger table from another datasource.
So, I'm wondering how I actually open a file and then parse it as html so I can poke around the DOM, all from the server side without involving a browser client.
I was wondering if there was a way to view the html code that javascript produced since viewing the source code shows the javascript if statements for netcrape and IE etc.