473,789 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How does the Link objects's disabled poperty works internally?

40 New Member
Hi All
If i use the below code i am able to disable the style sheet of a document.
But i wanted to understand how this disabled property works internally? becaues in html normally if we do any change that will be reflected only after refresh. but here the stylesheet change of a html document is achieved with out any refresh. i want to understand how this achieved. Can any one help me?


Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <link rel="stylesheet" type="text/css" 
  4. id="style1" href="try_dom_link.css" /><script type="text/javascript">
  5. function disableStyle()
  6.   {
  7.   document.getElementById("style1").disabled=true
  8.   }
  9. </script>
  10. </head>
  11. <body><form>
  12. <input type="button" id="button1" onclick="disableStyle()" 
  13. value="Disable style sheet" />
  14. </form></body>
  15. </html>
  16.  
Thank you in Advance :)
Sep 18 '08 #1
7 1403
gits
5,390 Recognized Expert Moderator Expert
what you reallly do here is setting a javascript-property of an element. this is instantly rendered but this would be even the case when you would use:

Expand|Select|Wrap|Line Numbers
  1. node_ref.setAttribute('disabled', 'disabled');
you could even set the className property of the node to another css-class and the changes are made during runtime ... and of course: just for the runtime. that's one of the purposes of javascript ... adding runtime-behaviour to your page.

as you see there are different ways to achieve a disabled-state for an element, and you should decide for only one to avoid difficult debugs when mixing the attribute-seeting with property-settings ... in case you used the attribute method you have to remove the attribute to reenable the field again ... when using the property you may set it to false ...

i hope this helps you?

kind regards
Sep 22 '08 #2
Rsmastermind
93 New Member
This is something complex question but verbally,When the page is loaded fully now the page is reserved for the browser and for the events of the javascripts.

Like If you have worked on the servers the jars and wars are created to reserve the java files and web files any change from outside means in the code will not effect until the server started again.So using event handlers that is in client side
we can change the dynamic properties.Like what you had done in your codes.
disable is an attribute to each field .

When you run the script you are doing it dynamically not permanently.But any change in the CSS file will be permanent change.

I hope you will be having some idea after reading the above things.
Sep 22 '08 #3
gits
5,390 Recognized Expert Moderator Expert
... So using event handlers that is in client side
we can change the dynamic properties.Like what you had done in your codes.
disable is an attribute to each field . ...
there is a difference between attributes and js-properties of a dom-node ... as i mentioned in my previous post ... so it is good to use the words in this case with more care. attributes are the node's html/xml-attributes ... properties are the javascript-properties of the object ... there are differences in their use and mixing something could lead to some confusion ...

kind regards
Sep 22 '08 #4
Rsmastermind
93 New Member
Ok fine as I had written in the very begining that this is explained verbally.So I tried it verbally not caring much more about the terminology.

But thank you for the suggestion I will take care of that.
Sep 22 '08 #5
gits
5,390 Recognized Expert Moderator Expert
i understand that ... i just wanted to point that out for readers in the future :)
Sep 22 '08 #6
Revathi Balakrishnan
40 New Member
i understood that this stylesheet disabling property is achived with javascript's dynamic behaviour.[if i misunderstood correct me]

gits and RSmastermind thank you for your help.
Sep 23 '08 #7
Rsmastermind
93 New Member
Most welcome .
This is the way we learn and share the knowledge.
More you ask more you learn.
Sep 25 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

8
4199
by: Ken Varn | last post by:
Everytime I call Process.GetCurrentProcess() the system goes out to the floppy drive. Why does this happen. I decided to use FileMon to get a log of what is happening when this occurs. Here is the log: 1 4:31:10 PM BlockedConfigAp:1340 IRP_MJ_CREATE A: DASD SUCCESS Attributes: Any Options: Open 2 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_DEVICE_CONTROL A: DASD INVALID DEVICE REQUEST IOCTL: 0x560000 3 4:31:11 PM BlockedConfigAp:1340...
3
4454
by: WinstonSmith | last post by:
Hello everyone, I got a problem about GC when creating large fields (some MB), set reference to null and call GC.Collect. Not all virtual mem is released. Situation improved in .net 1.1 but not in a full satisfying way. Has anyone a solution to handle large object in safe code? (Unsafe mem management works, but has serious disadvantages on serialization.)
7
3454
by: olga | last post by:
Hi, On my site, i want to pass a javascript variable to php. I know that this needs to done in a link or in a post. I want to know if there is a way i can do it with an html link. I should mention that these will be dynamically created links in php. This is an optional value so if javascript is disabled, my site will still function. the browser_width() function works correctly but when i
12
7401
by: | last post by:
I know how to use a StringBuilder, which supposedly does not create a new copy of it each time you modify it contents by adding or removing text. But, I wonder how does it do that internally ? I was planning to use a stringbuilder to hold big amounts of text, with several megs o size, to be read later based on fixed offsets, so I need to know if this is suitable for it.
3
2260
by: Lionel Schiepers | last post by:
I rencently tested an web application with ISAPI extensions that internally use managed extensions but the call to the ISAPI failed. I receive the following message: "A dynamic link library (DLL) initialization routine failed." in my browser. These ISAPI extension work when they execute under W2K or WXP. To reproduce the problem, I've create a simple isapi extension with visual studio 2002 and visual studio 2003 and changed the code with:
7
13223
by: Moses | last post by:
Hi Everybody, I have a problem with onClick event which works in FF and does not work in IE, Here I have giving the details Please help. I am creating a <aTag. dom_obj = document.createElement('a'); dom_obj.setAttribute('href', 'javascript:void(0)'); dom_obj.setAttribute('onclick', 'javascript:test()');
1
1421
by: JohnIdol | last post by:
Hi All, I am using this funcion to manipulate form elements; every thing works fine except the reference to the disabled property. Any help (the property works fine when used in classic manner)? Thanks! G
8
3044
by: Neil | last post by:
I just started using Access 2003, and I can't link a SQL Server table. I right-click on the database window; select Link Tables; and select ODBC Databases from the Files of Type dropdown. As soon as I select ODBC Databases from the Files of Type dropdown, the entire dialog box disappears. No error message. Just disappears, and I'm back at the database window. I have tried this with other databases, including a brand new blank one, and...
3
7946
by: =?Utf-8?B?UGxhdGVyaW90?= | last post by:
I have link buttons in a Gridview that, depending on the value in another column (Not the Key column) will need to be disabled. For example, (Column2 has link buttons) Column1 Column2 Books 54 Videos 6 Audio 3
0
9663
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
10404
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
10195
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...
0
9979
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...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6765
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();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2906
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.