Javascript Function Has No Properties In Javascript Console
May 25, 2005
I'm getting errors in Firefox everytime I try to run this frame resize code, but it works fine in IE. I can't seem to figure out what the problem is with it.
The error is: Error: theFrame has no properties
Line: 8
The line that the javascript console is showing an error for is in italics.
code from page:
<html>
<head>
<script type="text/javascript">
var defaultCols="100px,*";
var hiddenCols="0px,*";
function ShowHideMenu(){
theFrame = document.getElementById("framed");
if(theFrame.cols == defaultCols) theFrame.cols=hiddenCols;
else theFrame.cols=defaultCols;
}
</script>
<frameset cols="100px,*" name="framed">
<frame src="lframe.htm" name="frameMenu">
<frame src="mframe.htm" name="content">
</frameset>
</head>
<body>
</body></html>
Come someone let me know what I'm doing wrong here?
View 2 Replies
ADVERTISEMENT
Apr 13, 2005
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.
View 1 Replies
View Related
Jul 23, 2005
I would like to generate a page of links including some of the pdf properties (title, author, version, etc.) for a folder full of pdf's. Is this possible from Javascript?
View 4 Replies
View Related
Nov 8, 2005
Is it possible to remove the site address from the title to a javascript window?
View 3 Replies
View Related
Jul 23, 2005
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)
{
picWindow=window.open('','','width=25,height=25,sc rollbars=1,resizable=1');
picWindow.document.writeln('<html> <head>');
picWindow.document.writeln('<SCR' + 'IPT type="text/javascript"
LANGUAGE="JavaScript1.1" SRC="resizewindow.js"></SCR' + 'IPT>');
picWindow.document.writeln('</head>');
picWindow.document.writeln('<body onload="resizewindow();">');
picWindow.document.writeln('<img src=' + pic + '>');
picWindow.document.writeln('</body> </html>');
picWindow.document.close();
}
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.
View 9 Replies
View Related
Dec 17, 2001
how the class attribute works in CSS: I can specify that every attribute with class="foo" be italicized with: .foo {font-style: italic;}
What if I want to do the same sort of thing in Javascript? Is there something built-in like document.GetElementsbyClass("foo").style = "italic" (I'm just making this code up of the top of my head, I don't know how javascript works.)
It seems to me that with JavaScript you're supposed to use the name="" attribute instead of class="". Why the diference?
I looked at webmonkey that had an article about this, but their writing style is simply confusing and I can't make heads or tails of their articles.
View 1 Replies
View Related
Oct 21, 2005
I have some javascript that I have written into the <body> section and it works great. But I would like to make it into a javascript function and define the function in the <head> section. Then in the <body> section write a small bit of javascript that would call the function() object. Code:
View 2 Replies
View Related
Jul 17, 2010
I am getting $document.ready(function() not defined in the firebug console. I have seen that in most cases this is caused when the jQuery core is missing or the path is invalid. I do not believe this is the problem in my case becuase firebug shows the code as being loaded successfully and it is readable.
I have the following scripts in my head;
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.validate.js"></script>
<script type="text/javascript">
jQuery.validator.addMethod(
"selectNone",
function(value, element) {
if (element.value == "none") {
return false;
}}, .....
View 3 Replies
View Related
Jul 23, 2005
Hello, i have a flash menu, but i want to open a javascript popup. How can
i use this function that i'll use for TML in flash?
<SCRIPT language="javascript">
<!--
//if (self != top) {top.location.href = self.location.href}
function Pop550Picture(fname,breedte,hoogte){
var file = fname;
PopItUp=window.open(file,
'popup','width=600,height=550,toolbar=no,location= no,directories=no,status=n
o,scrollbars=yes,menubar=no,copyhistory=no,resizab le=no');
}
//-->
</SCRIPT>
View 1 Replies
View Related
Jul 23, 2005
consider this code below:
var toremove = "some";
var tolook ="I am looking for some other text in this string toremove";
if i do this:
tolook = tolook.replace(/toremove/gi,'');
will to look replace the text inside the toremove variable, or will it
just replace the variable name?
View 4 Replies
View Related
Feb 16, 2006
I have three different web pages with different domains, and I want to
show some pages of one of the webs in the others.
I use an iframe for this and it shows it good until I have to call a
javascript function in the iframe inside page, I have a permission
denied because the domains of these pages are different.
So, the cuestion is:
Is there some way to call the javascript function of the iframe from
the parent page?
View 2 Replies
View Related
Jul 20, 2005
Where can I download a complete javascript function list?
View 2 Replies
View Related
Jul 20, 2005
I'm working on a script(for giving points to a soccergame 0, 1 or 3 points)
that give a value to a hidden field, i got a function but only works on 1
field.
I want that the function loops till all hidden fields are fill in.
Here's what i got so far:
function myfunction()
{
if (document.form1.hgoals.value == document.form1.agoals.value){
document.form1.hpoints.value = (1)
document.form1.apoints.value = (1)
}
else if(document.form1.hgoals.value > document.form1.agoals.value){
document.form1.hpoints.value = (3)
document.form1.apoints.value = (0)
}
else if(document.form1.hgoals.value < document.form1.agoals.value){
document.form1.hpoints.value = (0)
document.form1.apoints.value = (3)
}
View 1 Replies
View Related
Aug 14, 2007
I am calling a javscript function name() defined in a file say external.js from a javascript function callFunction() defined in test.html.
The function name() has to call another javascript function say fullname() defined in test2.html. Code:
View 2 Replies
View Related
Aug 8, 2006
Please tell me about sleep function in javascript
View 11 Replies
View Related
Oct 21, 2006
does javascript have a get day function for the whole year?
View 1 Replies
View Related
Nov 19, 2007
In IE, it looks like you can have to many characters in a javascript function.
The content of an entire html page is put into this function...
function updateTemplate(content) {
content=content.replace(/'/g, ''');
content=content.replace(/"/g, '"');
content=content.replace(/</g, '<');
content=content.replace(/>/g, '>');
Element.update('template',content);
}
it seems to cut off the content after about 2060 characters. is that an IE thing or is there something wrong with my code. FF does it fine...
If it is an IE thing, is there anyway around it?
View 6 Replies
View Related
Jul 23, 2005
Attached is a simple HTML file that adds and delete rows. In the add
row function I set an attribute "onClick" this triggers the
testMessage() function. When I try this in Firefox it works just fine
however on IE it just refuses to work.
What is interseting is the ROW that already exists has a similar
'onClick' event which works when the page is loaded, but subsequent
"row" additions to the table to not work in IE. Code:
View 9 Replies
View Related
Feb 19, 2007
two possibilities or the attribute type of script:
text/javascript (the one i usually use) application/x-javascript
what are the differencies between both?
depends on the html content?
for example html 4.0.1 versus xhtml 1.1?
View 12 Replies
View Related
Mar 30, 2006
I'm already past the basics of Javascript, and i need something that takes me to the other level and teaches me the new technologies and cool stuff (drag&drop, AJAX, OOP in javascript, maybe XUL...etc). So far i found these two books:
1. Sitepoint's "The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks".
2. Worx's "Professional JavaScript for Web Developers (Wrox Professional Guides)"
Both seems to cover very insteresting topics, but i can only buy one of them. So which one do you suggest?
and by the way, i've read the sample chapter 5 of Sitepoint's book, and it seems like the author(s) just put the solutions/codes there and let you figure them out on your own. Is this how the rest of the chapters are?
View 3 Replies
View Related
Jul 23, 2005
I bringing up a list of movies in a separate window where each one has an
"onclick" function which is suppose to call a procedure and pass in the
variables and display the details of the selected record. When I click on a
record nothing happens. Code:
View 2 Replies
View Related
Jul 23, 2005
I have a select dropdown and 5 text fields. based on the option
selected (which are the units - cm/mm/inches/ft/yard etc), i change
the values in the text fields using javascript to the corresponding
units.
my problem is that when the options are selected very quickly(for eg
using the keyboard's up/down keys) then quickly, the text field values
lose their connection with the select box and the values become
illegal.
I suspect that the javascript function is being called even before the
earlier execution has not terminated. I tried using a global variable and using it as a lock, but still no success.
View 1 Replies
View Related
Aug 1, 2005
I am coding an AJAX DHTML whatever application and I was fed up with
always typing a lot of appendChild() functions.
I created a custom one called append_children() and wanted to share it
if anyone need such a function.
function append_children() {
var a = append_children.arguments;
for ( var i = a.length - 1; i > 0 ; i-- ) {
try {
a[i-1].appendChild(a[i]);
} catch(e) {
for ( var j = 0; j < a[i].length; j++ ) {
append_children(a[i-1], a[i][j]);
}}}}
View 2 Replies
View Related
Apr 19, 2006
i tried checking for document.function_name(), but that apparantly does
not work. Anybody got an answer to this one?
View 2 Replies
View Related
Jul 20, 2005
I have a input field like this
<input name="To" type="text" class="input" value="<%=toList%>" size="106"
this calls validateUser() as soon as I update the input field and lose focus
from it.
What I want is that this validateUser() should also be called on the intial
<%=toList%> that I am filling. I tried adding
but that didn't work.
What should I use ?
View 1 Replies
View Related
Jul 20, 2005
function CheckImageBtn(eleName,sortfield)
{
document.forms[0].sortby.value=sortfield;
document.forms[0].txtIsHrefClick.value = 'Y'
var objElem;
objElem=eval("document.all."+eleName);
objElem.focus();
objElem.click();
return true;
}
View 1 Replies
View Related