|
You can't add "alert('hi')" - it MUST be a function name (without quotes). Underneath it all, this all comes down to COM implementations. attachEvent takes a string that identifies the event name and a VARIANT that is a function pointer - NOT a string. There is no magic involved here and you must follow symantecs. Instead, try somthing like this:
<script language="javascript">
function sayHi()
{
alert("Hi!");
}
myElem.onclick = sayHi;
myElem.attachEvent("onclick", sayHi);
</script> When you use setAttribute , you might thing that this would work from an HTML standpoint, but this isn't manipulating the HTML - it's creating an HTML element in the HTML Document Object Model (DOM) that would've otherwise been read by MSHTML from the HTML document. Instead, you must attach the event handler correctly. Again, the event is not an attribute though it can be represented by an attribute. MSHTML will know better and will hookup a function (or create on in memory that wraps the code you put in the HTML attribute) when it reads the HTML attributes on the element.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
thanks alot, did not have a chance to test yet, but makes sense.
is there a way I can also pass a parameter with the function? (not in quotes)
I do have a way around it if not, but it's easier if I can.
thanks,
webProgrammer
|
|
|
|
|
No you can't, since it's a function pointer. The caller is responsible for passing any arguments to your functions, so the function signature should match what the event has documented.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Actually, you can if you use an intermediate function:
myElement.attachEvent("onclick", function(eventData)
{
if (!eventData) eventData = window.event;
element_OnClick(myElement, eventData);
});
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hi
I want to use the css style properties in my one of my columns of a table, but can't get the code working.
I want to use the code
body
{
background-image:
url("/images/smiley.gif");
background-repeat:
no-repeat;
background-attachment:
fixed
}
in a table, like:
body
{
background-image:
url("/images/smiley.gif");
background-repeat:
no-repeat;
background-attachment:
fixed
}
|
appreciate any help
tx
|
|
|
|
|
try putting a semi-colon after "fixed"
i had trouble with this before
"there is no spoon" biz stuff about me
|
|
|
|
|
l a u r e n wrote:
try putting a semi-colon after "fixed"
I get to display the image, but because of the body {} command it's the background for the whole page. I want to know how to display this image one in the table column!
|
|
|
|
|
then set a style for the table column:
.tcp {bgpic: blah blah};
///////
etc
"there is no spoon" biz stuff about me
|
|
|
|
|
Hello Everyone,
I wanted to know your view point on the current discussions we are having.
We want to launch a web site for our company. What should be the design parameters of it?
Do u think that in this present times of flashy fashion, some catchy flash orieted site is a dire requirement or the good old lots-of-information kinda sites are still good?
Thanks in advance....
merry christmas
"The chance of the bread falling with the buttered side down is directly proportional to the cost of the carpet." Muphy's Law
|
|
|
|
|
vivek_mastishk wrote:
merry christmas
Same to u too.
vivek_mastishk wrote:
kinda sites are still good
It all depends on the kind of website you are looking for. If yours is a 'content based' site then it wont be of necessary to go for a flashy site.
If yours is a 'revenue model' site, you should go for something to increase visitors for the site.
So, make a decession on what you are going to put on the site!!
I was born intelligent Education ruined me!.
|
|
|
|
|
IMHO it goes like this...
Everything thats know to catch someones attention should be used.
If you offer only copious amounts of content and a not so plesant interface or nice flash intro or banners or whatever...SOMEONE ELSE WILL!!!
I used to think that windows apps should ONLY be fully functional and never bothered with interface design or cool niceties...
Ever played with Window washer and then History Kill?
Windows washer has it all...powerful, easy to use, looks super cool...it's simply the stuff good apps are made of...
Just my opinion
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
It depends on your audience, your image, and the purpose of site.
Personally, I click 'Skip Intro' whenever possible on any site that has a flash intro. I think they are useless, and come between me and whatever it is I'm trying to do. If you must have one, keep it short (3-5 sec.).
The organization of your site is more important than how cool it looks, IMO. Having said that, a graphically pleasing site it always a good idea, as long as you don't sacrifice too much in terms of usability.
So, once you have the organization(conetent and navigation) of your site laid out, then you can decide on how you want it to look. What image do you want to portray? This may cause a need for fancier graphics or even some flash, I suppose. The point is there is a balance that will work for your case.
"Things are not what they seem. Nor are they any different." BW
CP Member Homepages
|
|
|
|
|
I totally agree to your opinion...
This is the most profesional way to go...
There are good and bad flashy web sites and there are good and bad content based web sites... There are also good and bad websites that are a bit of both...
You need to find the balance depending on what your target group is and what the image of your comapny is. I wouldnt take seriously a financial companys web site if it was too flashy and it would be boring to have content based and serious web site for a company that make computer games...
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
Hi,
Just go to this site http://www.auh.eud. At the front page there is a 'FLASH' animation. Can anyone help me to know what font is that anyway please????!!!!
I was born intelligent Education ruined me!.
|
|
|
|
|
SPS wrote:
http://www.auh.eud
There is no site there at the moment, I just get IE's page not found page - that's in Verdana
If you meant auh.edu, there is a "american western" text style flash animation, but it may not be a font, just some bitmaps - I don't recognise it. Why not ask their web master?
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
Ian Darling wrote:
There is no site there at the moment, I just get IE's page not found page - that's in Verdana
If you meant auh.edu, there is a "american western" text style flash animation, but it may not be a font, just some bitmaps
Actually I was asking about the font in the 'flash' animation. Anyway, I was able to 'find' the font. Thanks to 'fonts.com'.
I was born intelligent Education ruined me!.
|
|
|
|
|
Hi,
I have an HTML doc, and nested inside it is another doc in an iframe. In the inner doc, I have some script and need some way of getting a reference to the javascript objects of the outer doc - I plan to use this to get a copy of the outer doc's html in string. But, I can modify the outer doc at all. Is it possible?
*¨¨`)
¸¸.·´ ¸.·*¨¨`)
(¸¸.·* ¸ .·*
¸¸.·*
(¸¸.~~> Joel Holdsworth.
|
|
|
|
|
You can access HTML elements and FORM elements as well as JavaScript Variables from within the IFRAME.
Can reference to them by using the top. keyword or the parent. I think...
E.g.
If you have a javascript variable in the main doc as such:
var myVar;
Then you can access this from within the IFRAME as such:
top.myVar
Hope this helps ...
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
I select a picture (or text) on a HTML page.How do I get the HTML source code of the selected objects.Is it possible???
|
|
|
|
|
I haven't ever done this but there is an event which you can use. Its the :
onselectstart
event that is supported by IE for sure but I dont know if NS or Opera supports it.
Once you capture the event passing the object that triggerred the event you should be able to use the some of the following properties t get the relavent HTML code:
innerHTML ,
outerHTML ,
outerTEXT ,
outerTEXT
Hope this helps
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
Is there any text data compression algorithm in javascript...
wanna to compress the text of the Textarea before submitting to the server
Thanks
Usman
|
|
|
|
|
Hi everyone, I just wanna ask if there is a way to switch between input locales in a textarea without having to press the altkey and shift key.
I've tried to use window.event object but both properties altKey and shifKey are read only and therefore cannot be set.
How can i simulate the pressing of altKey and shiftKey through scripts to switch between the languages in a textarea tag.
You help is greatly appreciated.
Nader.
|
|
|
|
|
Instead of stimulating the keypress, what you can do is to "stimulate" the result...
i.e. use the focus() method on the textarea you want to "tab" to.
e.g.
<br />
<textarea id="oText1"></textarea><textarea id="oText2"></textarea><br />
<br />
<script ...><br />
document.all.oText2.focus();<br />
</script><br />
Hope this helps.
|
|
|
|
|
I am not trying to set the focus on the text area.
I have two different languages on my systerm say A & B.
The active language on the system now is A.
All I want is to switch to language B when the focus is set on the text area as if the user has pressed the altkey and shiftKey to switch between the two languages.
|
|
|
|
|
Hi,
I know MSKB has a list of tags supported by PIE 3.0.. however, it does not list the attributes supported...
Is there a resource page anywhere where we can view the full list of attributes (as well as CSS properties) supported for PIE? much like MSDN Library's HTML reference.
For eg, does tag support the height attribute? height for tr is something only MSIE supports but does PIE support it?
Thanks.
|
|
|
|