473,836 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Style is null or not an object

I'm getting the following error:

brian.style is null or not an object on the following code...can anyone
help?

<html>
<head>
<script>
<!--
function brianIt(){
brian.style.hei ght = 12;
}
//--></script>
</head>
<body>This website is currently under construction.
<iframe id="brian" width="105" src="index.asp" >iFrame it</iframe>
</body>
</html>

Thanks

Aug 29 '05 #1
3 10728
bd*********@gma il.com said the following on 8/29/2005 4:16 PM:
I'm getting the following error:

brian.style is null or not an object on the following code...can anyone
help?
The iframe does not have a style attribute so IE won't read it unless
you explicitly set it.
No DTD. Give it one.
<html>
<head>
<script>
<script type="text/javascript">
<!--
Script hiding is obsolete and can actually cause problems in some DTD's
function brianIt(){
brian.style.hei ght = 12;
http://jibbering.com/faq/#FAQ4_41

document.frames['brian'].style.height = "12px";

The unit is required.
}
//-->
Script hiding is obsolete and can actually cause problems in some DTD's

</script> </head>
<body>This website is currently under construction.
<iframe id="brian" width="105" src="index.asp" >iFrame it</iframe>


<iframe name="brian" style="width:10 5px;height:10px "
src="index.asp" >iFrame it</iframe>

Beginning with valid HTML will go a long way in solving "problems".

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 29 '05 #2
Lee
bd*********@gma il.com said:

I'm getting the following error:

brian.style is null or not an object on the following code...can anyone
help?

<html>
<head>
<script>
<!--
function brianIt(){
brian.style.he ight = 12;
}
//--></script>
</head>
<body>This website is currently under construction.
<iframe id="brian" width="105" src="index.asp" >iFrame it</iframe>
</body>
</html>


I don't believe you. That code should not show any error.
You're not even calling the function.
Please don't post make-believe code and ask for help with it.

You don't need the comments around the code. They're obsolete.
You can't refere to an object by it's id name, use the
getElementById( ) method:
<html>
<head>
<script>
function brianIt(){
document.getEle mentById("brian ").style.he ight = 12;
}
</script>
</head>
<body onload="brianIt ()">
This website is currently under construction.
<iframe id="brian" width="105" src="index.asp" >iFrame it</iframe>
</body>
</html>

Aug 29 '05 #3
Lis
some say, the biggest bussines is where u fool and get
foold... i say...

i frames got no closing tags.
do you have to set the style var directly to the iframe tag?
so html is doing an object for style thats passed to
javascript.
the other way ist to speak directly to height without style.
correct?
On 29 Aug 2005 13:16:04 -0700, bd*********@gma il.com wrote: I'm getting the following error:

brian.style is null or not an object on the following code...can anyone
help?

<html>
<head>
<script>
<!--
function brianIt(){
brian.style.he ight = 12;
}
//--></script>
</head>
<body>This website is currently under construction.
<iframe id="brian" width="105" src="index.asp" >iFrame it</iframe>
</body>
</html>

Thanks


Aug 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
2477
by: Desmond Liu | last post by:
I've read articles like Scott Meyer's EC++ (Item 22) that advocate the use of references when passing parameters. I understand the reasoning behind using references--you avoid the cost of creating a local object when you pass an object by reference. But why use a reference? Is there any inherent advantage of using a reference over using a pointer? My workplace discourages the use of pointers when it comes to parameter passing. They...
1
3571
by: Tristan Miller | last post by:
Greetings. I am trying to write a function which toggles the display of a certain class of <div> elements in an HTML page. The CSS file initially sets some classes to "display: none", and others to "display: block". The problem I am encountering is that when the JavaScript interpreter starts up initially, all style.displays are null. Thus the following code is not effective: function toggleAll(itemname) {
21
4012
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does nothing in IE. I'd be greatful for any assistance. Also, if I will have problems the code on Opera or Safari, I'd appreciate any pointers--I don't have a Mac to test Safari. THanks very much, Michael
54
2937
by: Sander | last post by:
1. I was having a discussion with somebody and I think it's just religious. We are developing some software and he was looking through my code. I use if (pointer) to test a pointer for NULL. He says it must be if (p!=NULL). The arguments are that it's more readable and that if (p) is not portable. I said the first is a style issue and that I think if(p) is more readable and that the second is plain wrong. So, is he right about the...
4
2543
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView Inherits System.Windows.Forms.UserControl Private _Collection As GridTableStylesCollection
10
2371
by: p3t3r | last post by:
I have a treeview sourced from a SiteMap. I want to use 2 different CSS styles for the root level nodes. The topmost root node should not have a top border, all the other root nodes should have a top border. Is it possible to have more than 1 style at the same level (parent node) when using a SiteMap? I want it to appear something like this and I can only find a way to either have the border on all root nodes or none at all. In...
4
2237
by: jarek | last post by:
Hi, this is my code: CSSStyleDeclaration.prototype.__defineSetter__('display', displaySetter); function displaySetter(value) { var parent = findParent(document, this); if (parent) {
3
2003
by: Paul Lautman | last post by:
If I have the following: <style type="text/css"> ..nd { display : none; } </style> <input type="checkbox" id="b1" class="nd"/> how do I tell (in javascript) that the checkbox's display status is
0
9820
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10846
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10551
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10594
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4458
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.